sim-node-lib 0.4.71 → 0.4.73
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.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare enum ExceptionsCodesEnum {
|
|
2
2
|
authorizationFaliure = "E_AUTHORIZATION_FAILURE",
|
|
3
3
|
badRequest = "E_BAD_REQUEST",
|
|
4
|
-
internalServerError = "E_INTERNAL_SERVER_ERROR",
|
|
5
4
|
invalidApiToken = "E_INVALID_API_TOKEN",
|
|
6
5
|
invalidAuthPassword = "E_INVALID_AUTH_PASSWORD",
|
|
7
6
|
invalidAuthUid = "E_INVALID_AUTH_UID",
|
|
@@ -11,5 +10,9 @@ export declare enum ExceptionsCodesEnum {
|
|
|
11
10
|
rowNotFound = "E_ROW_NOT_FOUND",
|
|
12
11
|
tooManyRequests = "E_TOO_MANY_REQUESTS",
|
|
13
12
|
unauthorized = "E_UNAUTHORIZED_ACCESS",
|
|
14
|
-
validationFailed = "E_VALIDATION_FAILURE"
|
|
13
|
+
validationFailed = "E_VALIDATION_FAILURE",
|
|
14
|
+
internalServerError = "E_INTERNAL_SERVER_ERROR",
|
|
15
|
+
notImplemented = "E_NOT_IMPLEMENTED",
|
|
16
|
+
badGateway = "E_BAD_GATEWAY",
|
|
17
|
+
serviceUnavailable = "E_SERVICE_UNAVAILABLE"
|
|
15
18
|
}
|
|
@@ -5,7 +5,6 @@ var ExceptionsCodesEnum;
|
|
|
5
5
|
(function (ExceptionsCodesEnum) {
|
|
6
6
|
ExceptionsCodesEnum["authorizationFaliure"] = "E_AUTHORIZATION_FAILURE";
|
|
7
7
|
ExceptionsCodesEnum["badRequest"] = "E_BAD_REQUEST";
|
|
8
|
-
ExceptionsCodesEnum["internalServerError"] = "E_INTERNAL_SERVER_ERROR";
|
|
9
8
|
ExceptionsCodesEnum["invalidApiToken"] = "E_INVALID_API_TOKEN";
|
|
10
9
|
ExceptionsCodesEnum["invalidAuthPassword"] = "E_INVALID_AUTH_PASSWORD";
|
|
11
10
|
ExceptionsCodesEnum["invalidAuthUid"] = "E_INVALID_AUTH_UID";
|
|
@@ -16,4 +15,8 @@ var ExceptionsCodesEnum;
|
|
|
16
15
|
ExceptionsCodesEnum["tooManyRequests"] = "E_TOO_MANY_REQUESTS";
|
|
17
16
|
ExceptionsCodesEnum["unauthorized"] = "E_UNAUTHORIZED_ACCESS";
|
|
18
17
|
ExceptionsCodesEnum["validationFailed"] = "E_VALIDATION_FAILURE";
|
|
18
|
+
ExceptionsCodesEnum["internalServerError"] = "E_INTERNAL_SERVER_ERROR";
|
|
19
|
+
ExceptionsCodesEnum["notImplemented"] = "E_NOT_IMPLEMENTED";
|
|
20
|
+
ExceptionsCodesEnum["badGateway"] = "E_BAD_GATEWAY";
|
|
21
|
+
ExceptionsCodesEnum["serviceUnavailable"] = "E_SERVICE_UNAVAILABLE";
|
|
19
22
|
})(ExceptionsCodesEnum = exports.ExceptionsCodesEnum || (exports.ExceptionsCodesEnum = {}));
|
|
@@ -59,6 +59,9 @@ function errorSwitch(error, ctx, logger) {
|
|
|
59
59
|
case Enums_1.ExceptionsCodesEnum.routeNotFound:
|
|
60
60
|
logger.warn(error);
|
|
61
61
|
return ctx.response.notFound(new BasicException_1.default(error.code, Enums_1.ExceptionsMessagesEnum.routeNotFound));
|
|
62
|
+
case Enums_1.ExceptionsCodesEnum.serviceUnavailable:
|
|
63
|
+
logger.error(error);
|
|
64
|
+
return ctx.response.serviceUnavailable(new BasicException_1.default(error.code, error.message));
|
|
62
65
|
default:
|
|
63
66
|
logger.error('Erro: ' + error);
|
|
64
67
|
logger.error('Code: ' + error.code);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sim-node-lib",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.73",
|
|
4
4
|
"description": "Library from SIMLabs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -60,5 +60,6 @@
|
|
|
60
60
|
"providers": [
|
|
61
61
|
"sim-node-lib"
|
|
62
62
|
]
|
|
63
|
-
}
|
|
63
|
+
},
|
|
64
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
64
65
|
}
|