@munlib/common 1.0.176 → 1.0.179
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.
|
@@ -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 {
|
|
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/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
// Re-export stuff from errors and middlewares
|
|
18
|
+
__exportStar(require("./errors/bad-request-error"), exports);
|
|
18
19
|
__exportStar(require("./errors/custom-error"), exports);
|
|
19
20
|
__exportStar(require("./errors/database-connection-error"), exports);
|
|
20
21
|
__exportStar(require("./errors/not-authorized-error"), exports);
|