@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.
Files changed (2) hide show
  1. package/build/index.js +6 -4
  2. 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
- if (responseError.details) {
231
- lodash_1.default.forEach(responseError.details, function (value, key) {
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
- responseError.details[key] = undefined;
235
+ grpcDetails[key] = undefined;
235
236
  }
236
237
  });
238
+ responseError.details.details = grpcDetails.filter(Boolean);
237
239
  }
238
240
  }
239
241
  if (onRequestFailed) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/gateway",
3
- "version": "4.10.3",
3
+ "version": "4.10.4",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "main": "build/index.js",