sim-node-lib 0.4.87 → 0.4.88
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.
|
@@ -4,4 +4,6 @@ export default class BasicServerException {
|
|
|
4
4
|
message: string | ExceptionsMessagesEnum;
|
|
5
5
|
status?: number | undefined;
|
|
6
6
|
constructor(code: ExceptionsCodesEnum, message: string | ExceptionsMessagesEnum, status?: number | undefined);
|
|
7
|
+
static badRequest(message: string): BasicServerException;
|
|
8
|
+
static internalServerError(message: string): BasicServerException;
|
|
7
9
|
}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Enums_1 = require("../../Enums");
|
|
3
4
|
class BasicServerException {
|
|
4
5
|
constructor(code, message, status) {
|
|
5
6
|
this.code = code;
|
|
6
7
|
this.message = message;
|
|
7
8
|
this.status = status;
|
|
8
9
|
}
|
|
10
|
+
static badRequest(message) {
|
|
11
|
+
return new this(Enums_1.ExceptionsCodesEnum.badRequest, message, 400);
|
|
12
|
+
}
|
|
13
|
+
static internalServerError(message) {
|
|
14
|
+
return new this(Enums_1.ExceptionsCodesEnum.internalServerError, message, 500);
|
|
15
|
+
}
|
|
9
16
|
}
|
|
10
17
|
exports.default = BasicServerException;
|