@gravity-ui/gateway 4.10.3 → 4.10.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
|
@@ -117,7 +117,7 @@ function generateGatewayApi(schema, config, grpcContext, baseApi) {
|
|
|
117
117
|
function generateGatewayApiController(schemasByScope, Api, config, controllerActions) {
|
|
118
118
|
// eslint-disable-next-line complexity
|
|
119
119
|
return async function gateway(req, res) {
|
|
120
|
-
var _a, _b, _c, _d;
|
|
120
|
+
var _a, _b, _c, _d, _e;
|
|
121
121
|
const { userId } = res.locals || {};
|
|
122
122
|
const { service, action, scope = 'root' } = req.params;
|
|
123
123
|
const withDebugHeaders = typeof config.withDebugHeaders === 'function'
|
|
@@ -227,13 +227,15 @@ function generateGatewayApiController(schemasByScope, Api, config, controllerAct
|
|
|
227
227
|
else {
|
|
228
228
|
responseError = lodash_1.default.omit(error, ['debug']);
|
|
229
229
|
// Remove DebugInfo
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
const grpcDetails = (_e = responseError.details) === null || _e === void 0 ? void 0 : _e.details;
|
|
231
|
+
if (grpcDetails) {
|
|
232
|
+
lodash_1.default.forEach(grpcDetails, function (value, key) {
|
|
232
233
|
const DEBUG_INFO_TYPE = 'type.googleapis.com/google.rpc.DebugInfo';
|
|
233
234
|
if ((value === null || value === void 0 ? void 0 : value['@type']) === DEBUG_INFO_TYPE) {
|
|
234
|
-
|
|
235
|
+
grpcDetails[key] = undefined;
|
|
235
236
|
}
|
|
236
237
|
});
|
|
238
|
+
responseError.details.details = grpcDetails.filter(Boolean);
|
|
237
239
|
}
|
|
238
240
|
}
|
|
239
241
|
if (onRequestFailed) {
|