@munlib/common 1.0.176 → 1.0.178

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.
@@ -7,5 +7,7 @@ export declare class BadRequestError extends CustomError {
7
7
  status: string;
8
8
  msg: string;
9
9
  code: string;
10
+ typeMsg: string;
11
+ userMsg: string;
10
12
  };
11
13
  }
@@ -16,20 +16,29 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.BadRequestError = void 0;
19
+ var instituciones_pagos_1 = require("../events/types/instituciones-pagos");
19
20
  var custom_error_1 = require("./custom-error");
20
21
  var erroresStatus_1 = require("./erroresStatus");
21
22
  var BadRequestError = /** @class */ (function (_super) {
22
23
  __extends(BadRequestError, _super);
23
24
  function BadRequestError(msg, statusCode) {
24
- var _this = _super.call(this, msg) || this;
25
+ var _this = _super.call(this, msg, "", "") || this;
25
26
  _this.msg = msg;
26
27
  _this.statusCode = 400;
27
28
  _this.statusCode = statusCode ? _this.statusCode : 400;
29
+ _this.typeMsg = instituciones_pagos_1.ErrorCategories.MIDDLEWARE;
30
+ _this.userMsg = erroresStatus_1.ErrorController.getErrorMessage(instituciones_pagos_1.ErrorCategories.MIDDLEWARE);
28
31
  Object.setPrototypeOf(_this, BadRequestError.prototype);
29
32
  return _this;
30
33
  }
31
34
  BadRequestError.prototype.serializeErrors = function () {
32
- return { status: erroresStatus_1.ErrorController.getGeneralStatus(this.statusCode.toString()), msg: this.message, code: this.statusCode.toString() };
35
+ return {
36
+ status: erroresStatus_1.ErrorController.getGeneralStatus(this.statusCode.toString()),
37
+ msg: this.message,
38
+ code: this.statusCode.toString(),
39
+ typeMsg: this.typeMsg,
40
+ userMsg: this.userMsg
41
+ };
33
42
  };
34
43
  return BadRequestError;
35
44
  }(custom_error_1.CustomError));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@munlib/common",
3
- "version": "1.0.176",
3
+ "version": "1.0.178",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",