@taladel/common 1.0.11 → 1.0.12
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,4 +1,3 @@
|
|
|
1
1
|
import { Request, Response, NextFunction } from "express";
|
|
2
|
-
declare const errorHandler: (err: Error, _req: Request, res: Response, _next: NextFunction) => void;
|
|
3
|
-
export default errorHandler;
|
|
2
|
+
export declare const errorHandler: (err: Error, _req: Request, res: Response, _next: NextFunction) => void;
|
|
4
3
|
//# sourceMappingURL=error-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../src/middlewares/error-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../src/middlewares/error-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGzD,eAAO,MAAM,YAAY,GACrB,KAAK,KAAK,EACV,MAAM,OAAO,EACb,KAAK,QAAQ,EACb,OAAO,YAAY,KACpB,IAQF,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.errorHandler = void 0;
|
|
3
4
|
const custom_error_1 = require("../errors/custom-error");
|
|
4
5
|
const errorHandler = (err, _req, res, _next) => {
|
|
5
6
|
if (err instanceof custom_error_1.CustomError) {
|
|
@@ -8,5 +9,5 @@ const errorHandler = (err, _req, res, _next) => {
|
|
|
8
9
|
console.error(err.stack);
|
|
9
10
|
res.status(500).json({ message: err.message || 'Internal Server Error' });
|
|
10
11
|
};
|
|
11
|
-
exports.
|
|
12
|
+
exports.errorHandler = errorHandler;
|
|
12
13
|
//# sourceMappingURL=error-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../src/middlewares/error-handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../src/middlewares/error-handler.ts"],"names":[],"mappings":";;;AACA,yDAAqD;AAE9C,MAAM,YAAY,GAAG,CACxB,GAAU,EACV,IAAa,EACb,GAAa,EACb,KAAmB,EACf,EAAE;IAEN,IAAG,GAAG,YAAY,0BAAW,EAAC,CAAC;QAC3B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,uBAAuB,EAAE,CAAC,CAAC;AAC9E,CAAC,CAAC;AAbW,QAAA,YAAY,gBAavB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {Request, Response, NextFunction } from "express";
|
|
2
2
|
import { CustomError } from "../errors/custom-error";
|
|
3
3
|
|
|
4
|
-
const errorHandler = (
|
|
4
|
+
export const errorHandler = (
|
|
5
5
|
err: Error,
|
|
6
6
|
_req: Request,
|
|
7
7
|
res: Response,
|
|
@@ -15,5 +15,3 @@ import { CustomError } from "../errors/custom-error";
|
|
|
15
15
|
console.error(err.stack);
|
|
16
16
|
res.status(500).json({ message: err.message || 'Internal Server Error' });
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
export default errorHandler;
|