@tramvai/module-common 5.53.94 → 5.53.111

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { ACTION_PARAMETERS, isTramvaiAction } from '@tramvai/core';
2
- import { PageActionsAbortError, isPageActionsAbortError, isSilentError, ExecutionAbortError } from '@tinkoff/errors';
2
+ import { PageActionsAbortError, isPageActionsAbortError, isSilentError, ExecutionAbortError, makeErrorSilent } from '@tinkoff/errors';
3
3
  import { actionServerStateEvent } from './actionTramvaiReducer.es.js';
4
4
  import { generateDeferredResolve, generateDeferredReject } from './deferred/clientScriptsUtils.es.js';
5
5
 
@@ -97,12 +97,16 @@ You can find more detailed information from "action-execution-error" logs, and f
97
97
  const reasonIsObject = typeof executionContext.abortSignal.reason === 'object';
98
98
  const timeoutError = reasonIsObject && isPageActionsAbortError(executionContext.abortSignal.reason);
99
99
  const silentError = reasonIsObject && isSilentError(executionContext.abortSignal.reason);
100
+ const executionError = new ExecutionAbortError({
101
+ message: `Execution aborted in context "${contextName}"`,
102
+ contextName,
103
+ reason: executionContext.abortSignal.reason,
104
+ });
105
+ if (silentError) {
106
+ makeErrorSilent(executionError);
107
+ }
100
108
  this.log[silentError ? 'info' : 'warn']({
101
- error: new ExecutionAbortError({
102
- message: `Execution aborted in context "${contextName}"`,
103
- contextName,
104
- reason: executionContext.abortSignal.reason,
105
- }),
109
+ error: executionError,
106
110
  event: `action-execution-error`,
107
111
  message: `${timeoutError ? `${actionName} has exceeded timeout of ${this.deps.limitTime}ms, execution results will be ignored` : `${actionName} execution error`}.
108
112
  This action will be automatically executed on client - https://tramvai.dev/docs/features/data-fetching/action#synchronizing-between-server-and-client
@@ -101,12 +101,16 @@ You can find more detailed information from "action-execution-error" logs, and f
101
101
  const reasonIsObject = typeof executionContext.abortSignal.reason === 'object';
102
102
  const timeoutError = reasonIsObject && errors.isPageActionsAbortError(executionContext.abortSignal.reason);
103
103
  const silentError = reasonIsObject && errors.isSilentError(executionContext.abortSignal.reason);
104
+ const executionError = new errors.ExecutionAbortError({
105
+ message: `Execution aborted in context "${contextName}"`,
106
+ contextName,
107
+ reason: executionContext.abortSignal.reason,
108
+ });
109
+ if (silentError) {
110
+ errors.makeErrorSilent(executionError);
111
+ }
104
112
  this.log[silentError ? 'info' : 'warn']({
105
- error: new errors.ExecutionAbortError({
106
- message: `Execution aborted in context "${contextName}"`,
107
- contextName,
108
- reason: executionContext.abortSignal.reason,
109
- }),
113
+ error: executionError,
110
114
  event: `action-execution-error`,
111
115
  message: `${timeoutError ? `${actionName} has exceeded timeout of ${this.deps.limitTime}ms, execution results will be ignored` : `${actionName} execution error`}.
112
116
  This action will be automatically executed on client - https://tramvai.dev/docs/features/data-fetching/action#synchronizing-between-server-and-client
@@ -1,5 +1,5 @@
1
1
  import { createChildContainer } from '@tinkoff/dippy';
2
- import { ExecutionAbortError, isSilentError } from '@tinkoff/errors';
2
+ import { isSilentError, ExecutionAbortError, makeErrorSilent } from '@tinkoff/errors';
3
3
  import { ROOT_EXECUTION_CONTEXT_TOKEN } from '@tramvai/tokens-common';
4
4
  import { COMMAND_LINE_TIMING_INFO_TOKEN } from '@tramvai/tokens-core-private';
5
5
 
@@ -88,11 +88,17 @@ class CommandLineRunner {
88
88
  await this.executeCommand(fn, command, di);
89
89
  }
90
90
  catch (error) {
91
- // in case if any error happens during line execution results from other line handlers will not be used anyway
92
- this.abortControllerByDi.get(di)?.abort(new ExecutionAbortError({
91
+ const silentError = error && typeof error === 'object' && isSilentError(error);
92
+ const executionError = new ExecutionAbortError({
93
93
  message: 'Execution context were aborted because of one of the commands failed',
94
94
  contextName: `command-line:${line}:${command.toString()}`,
95
- }));
95
+ reason: error,
96
+ });
97
+ if (silentError) {
98
+ makeErrorSilent(executionError);
99
+ }
100
+ // in case if any error happens during line execution results from other line handlers will not be used anyway
101
+ this.abortControllerByDi.get(di)?.abort(executionError);
96
102
  throw error;
97
103
  }
98
104
  });
@@ -1,5 +1,5 @@
1
1
  import { createChildContainer } from '@tinkoff/dippy';
2
- import { ExecutionAbortError, isSilentError } from '@tinkoff/errors';
2
+ import { isSilentError, ExecutionAbortError, makeErrorSilent } from '@tinkoff/errors';
3
3
  import { ROOT_EXECUTION_CONTEXT_TOKEN } from '@tramvai/tokens-common';
4
4
  import { COMMAND_LINE_TIMING_INFO_TOKEN } from '@tramvai/tokens-core-private';
5
5
 
@@ -88,11 +88,17 @@ class CommandLineRunner {
88
88
  await this.executeCommand(fn, command, di);
89
89
  }
90
90
  catch (error) {
91
- // in case if any error happens during line execution results from other line handlers will not be used anyway
92
- this.abortControllerByDi.get(di)?.abort(new ExecutionAbortError({
91
+ const silentError = error && typeof error === 'object' && isSilentError(error);
92
+ const executionError = new ExecutionAbortError({
93
93
  message: 'Execution context were aborted because of one of the commands failed',
94
94
  contextName: `command-line:${line}:${command.toString()}`,
95
- }));
95
+ reason: error,
96
+ });
97
+ if (silentError) {
98
+ makeErrorSilent(executionError);
99
+ }
100
+ // in case if any error happens during line execution results from other line handlers will not be used anyway
101
+ this.abortControllerByDi.get(di)?.abort(executionError);
96
102
  throw error;
97
103
  }
98
104
  });
@@ -92,11 +92,17 @@ class CommandLineRunner {
92
92
  await this.executeCommand(fn, command, di);
93
93
  }
94
94
  catch (error) {
95
- // in case if any error happens during line execution results from other line handlers will not be used anyway
96
- this.abortControllerByDi.get(di)?.abort(new errors.ExecutionAbortError({
95
+ const silentError = error && typeof error === 'object' && errors.isSilentError(error);
96
+ const executionError = new errors.ExecutionAbortError({
97
97
  message: 'Execution context were aborted because of one of the commands failed',
98
98
  contextName: `command-line:${line}:${command.toString()}`,
99
- }));
99
+ reason: error,
100
+ });
101
+ if (silentError) {
102
+ errors.makeErrorSilent(executionError);
103
+ }
104
+ // in case if any error happens during line execution results from other line handlers will not be used anyway
105
+ this.abortControllerByDi.get(di)?.abort(executionError);
100
106
  throw error;
101
107
  }
102
108
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-common",
3
- "version": "5.53.94",
3
+ "version": "5.53.111",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -31,35 +31,35 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@akashbabu/lfu-cache": "1.0.2",
34
- "@tinkoff/errors": "0.6.5",
35
- "@tinkoff/hook-runner": "0.7.6",
34
+ "@tinkoff/errors": "0.6.6",
35
+ "@tinkoff/hook-runner": "0.7.7",
36
36
  "@tinkoff/lru-cache-nano": "^7.9.0",
37
- "@tinkoff/pubsub": "0.8.4",
38
- "@tinkoff/url": "0.11.5",
39
- "@tramvai/experiments": "5.53.94",
40
- "@tramvai/module-cookie": "5.53.94",
41
- "@tramvai/module-environment": "5.53.94",
42
- "@tramvai/module-log": "5.53.94",
43
- "@tramvai/safe-strings": "0.8.6",
44
- "@tramvai/tokens-child-app": "5.53.94",
45
- "@tramvai/tokens-common": "5.53.94",
46
- "@tramvai/tokens-core-private": "5.53.94",
47
- "@tramvai/tokens-metrics": "5.53.94",
48
- "@tramvai/tokens-render": "5.53.94",
49
- "@tramvai/tokens-router": "5.53.94",
50
- "@tramvai/tokens-server-private": "5.53.94",
51
- "@tramvai/types-actions-state-context": "5.53.94",
37
+ "@tinkoff/pubsub": "0.8.5",
38
+ "@tinkoff/url": "0.11.6",
39
+ "@tramvai/experiments": "5.53.111",
40
+ "@tramvai/module-cookie": "5.53.111",
41
+ "@tramvai/module-environment": "5.53.111",
42
+ "@tramvai/module-log": "5.53.111",
43
+ "@tramvai/safe-strings": "0.8.7",
44
+ "@tramvai/tokens-child-app": "5.53.111",
45
+ "@tramvai/tokens-common": "5.53.111",
46
+ "@tramvai/tokens-core-private": "5.53.111",
47
+ "@tramvai/tokens-metrics": "5.53.111",
48
+ "@tramvai/tokens-render": "5.53.111",
49
+ "@tramvai/tokens-router": "5.53.111",
50
+ "@tramvai/tokens-server-private": "5.53.111",
51
+ "@tramvai/types-actions-state-context": "5.53.111",
52
52
  "hoist-non-react-statics": "^3.3.1"
53
53
  },
54
54
  "peerDependencies": {
55
- "@tinkoff/dippy": "0.11.7",
55
+ "@tinkoff/dippy": "0.11.10",
56
56
  "@tinkoff/utils": "^2.1.2",
57
- "@tramvai/cli": "5.53.94",
58
- "@tramvai/core": "5.53.94",
59
- "@tramvai/papi": "5.53.94",
60
- "@tramvai/react": "5.53.94",
61
- "@tramvai/state": "5.53.94",
62
- "@tramvai/tokens-server": "5.53.94",
57
+ "@tramvai/cli": "5.53.111",
58
+ "@tramvai/core": "5.53.111",
59
+ "@tramvai/papi": "5.53.111",
60
+ "@tramvai/react": "5.53.111",
61
+ "@tramvai/state": "5.53.111",
62
+ "@tramvai/tokens-server": "5.53.111",
63
63
  "react": ">=16.14.0",
64
64
  "tslib": "^2.4.0"
65
65
  },