@gravity-ui/gateway 3.2.3 → 3.2.4
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/build/index.js +6 -4
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -112,7 +112,7 @@ function generateGatewayApi(schema, config, grpcContext, baseApi) {
|
|
|
112
112
|
function generateGatewayApiController(schemasByScope, Api, config, controllerActions) {
|
|
113
113
|
// eslint-disable-next-line complexity
|
|
114
114
|
return async function gateway(req, res) {
|
|
115
|
-
var _a, _b, _c;
|
|
115
|
+
var _a, _b, _c, _d;
|
|
116
116
|
const { userId } = res.locals || {};
|
|
117
117
|
const { service, action, scope = 'root' } = req.params;
|
|
118
118
|
const withDebugHeaders = typeof config.withDebugHeaders === 'function'
|
|
@@ -212,13 +212,15 @@ function generateGatewayApiController(schemasByScope, Api, config, controllerAct
|
|
|
212
212
|
else {
|
|
213
213
|
responseError = lodash_1.default.omit(error, ['debug']);
|
|
214
214
|
// Remove DebugInfo
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
const grpcDetails = (_d = responseError.details) === null || _d === void 0 ? void 0 : _d.details;
|
|
216
|
+
if (grpcDetails) {
|
|
217
|
+
lodash_1.default.forEach(grpcDetails, function (value, key) {
|
|
217
218
|
const DEBUG_INFO_TYPE = 'type.googleapis.com/google.rpc.DebugInfo';
|
|
218
219
|
if ((value === null || value === void 0 ? void 0 : value['@type']) === DEBUG_INFO_TYPE) {
|
|
219
|
-
|
|
220
|
+
grpcDetails[key] = undefined;
|
|
220
221
|
}
|
|
221
222
|
});
|
|
223
|
+
responseError.details.details = grpcDetails.filter(Boolean);
|
|
222
224
|
}
|
|
223
225
|
}
|
|
224
226
|
if (onRequestFailed) {
|