@armi-wave/common 1.23.5 → 1.23.7
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,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const errorHandler:
|
|
1
|
+
import { ErrorRequestHandler } from 'express';
|
|
2
|
+
export declare const errorHandler: ErrorRequestHandler;
|
|
@@ -7,9 +7,9 @@ exports.errorHandler = void 0;
|
|
|
7
7
|
const custom_error_1 = __importDefault(require("../errors/custom-error"));
|
|
8
8
|
const errorHandler = (err, req, res, next) => {
|
|
9
9
|
if (err instanceof custom_error_1.default) {
|
|
10
|
-
|
|
10
|
+
res.status(err.statusCode).send({ errors: err.serializeErrors() });
|
|
11
|
+
return;
|
|
11
12
|
}
|
|
12
|
-
console.error(err);
|
|
13
13
|
res.status(400).send({
|
|
14
14
|
errors: [{ message: 'Something went wrong' }],
|
|
15
15
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@armi-wave/common",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -20,6 +20,12 @@
|
|
|
20
20
|
"express-validator": "^7.2.1",
|
|
21
21
|
"jsonwebtoken": "^9.0.2",
|
|
22
22
|
"minio": "^8.0.4",
|
|
23
|
-
"multer": "^1.4.5-lts.1"
|
|
23
|
+
"multer": "^1.4.5-lts.1",
|
|
24
|
+
"typescript": "^5.7.3"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/express": "^5.0.0",
|
|
28
|
+
"@types/jsonwebtoken": "^9.0.8",
|
|
29
|
+
"@types/multer": "^1.4.12"
|
|
24
30
|
}
|
|
25
31
|
}
|