@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.
Files changed (2) hide show
  1. package/build/index.js +6 -4
  2. 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
- if (responseError.details) {
216
- lodash_1.default.forEach(responseError.details, function (value, key) {
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
- responseError.details[key] = undefined;
220
+ grpcDetails[key] = undefined;
220
221
  }
221
222
  });
223
+ responseError.details.details = grpcDetails.filter(Boolean);
222
224
  }
223
225
  }
224
226
  if (onRequestFailed) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/gateway",
3
- "version": "3.2.3",
3
+ "version": "3.2.4",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "main": "build/index.js",