@gravity-ui/gateway 1.0.4 → 1.1.0
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.
- package/bin/patch.js +2 -2
- package/build/components/mixed.js +3 -2
- package/build/utils/common.js +4 -1
- package/package.json +1 -1
package/bin/patch.js
CHANGED
|
@@ -7,7 +7,7 @@ copyFileSync(
|
|
|
7
7
|
'patches/grpc-reflection-js+0.1.2.patch',
|
|
8
8
|
);
|
|
9
9
|
copyFileSync(
|
|
10
|
-
'node_modules/@gravity-ui/gateway/patches/protobufjs+6.11.
|
|
11
|
-
'patches/protobufjs+6.11.
|
|
10
|
+
'node_modules/@gravity-ui/gateway/patches/protobufjs+6.11.3.patch',
|
|
11
|
+
'patches/protobufjs+6.11.3.patch',
|
|
12
12
|
);
|
|
13
13
|
execSync('npx patch-package', {stdio: 'inherit'});
|
|
@@ -45,7 +45,7 @@ function createMixedAction(config, api, serviceName, actionName, extra, ErrorCon
|
|
|
45
45
|
}
|
|
46
46
|
if (e instanceof Error) {
|
|
47
47
|
const parsedError = (0, parse_error_1.parseMixedError)(e);
|
|
48
|
-
|
|
48
|
+
(0, common_1.handleError)(ErrorConstructor, e, ctx, 'Request failed', {
|
|
49
49
|
actionName,
|
|
50
50
|
serviceName,
|
|
51
51
|
parsedError,
|
|
@@ -54,8 +54,9 @@ function createMixedAction(config, api, serviceName, actionName, extra, ErrorCon
|
|
|
54
54
|
error: parsedError,
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
+
(0, common_1.handleError)(ErrorConstructor, e, ctx, 'Request failed');
|
|
57
58
|
throw {
|
|
58
|
-
error:
|
|
59
|
+
error: e,
|
|
59
60
|
};
|
|
60
61
|
}
|
|
61
62
|
finally {
|
package/build/utils/common.js
CHANGED
|
@@ -43,8 +43,11 @@ function handleError(ErrorConstructor, error, ctx, message, extra) {
|
|
|
43
43
|
if (error instanceof Error) {
|
|
44
44
|
ctx.logError(message, ErrorConstructor.wrap(error), extra);
|
|
45
45
|
}
|
|
46
|
+
else if (typeof error === 'string') {
|
|
47
|
+
ctx.logError(message, { error }, extra);
|
|
48
|
+
}
|
|
46
49
|
else {
|
|
47
|
-
ctx.logError(message,
|
|
50
|
+
ctx.logError(message, error, extra);
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
exports.handleError = handleError;
|