@kafritickets/common 1.0.6 → 1.0.9
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.
package/build/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Re-export stuff from errors and middlewares
|
|
17
18
|
__exportStar(require("./errors/bad-request-error"), exports);
|
|
18
19
|
__exportStar(require("./errors/custmor-error"), exports);
|
|
19
20
|
__exportStar(require("./errors/database-connection-error"), exports);
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,yDAAsC;AACtC,qEAAkD;AAClD,gEAA6C;AAC7C,2DAAwC;AACxC,oEAAiD;AAEjD,6DAA0C;AAC1C,8DAA2C;AAC3C,6DAA0C;AAC1C,iEAA8C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA8C;AAC9C,6DAA2C;AAC3C,yDAAsC;AACtC,qEAAkD;AAClD,gEAA6C;AAC7C,2DAAwC;AACxC,oEAAiD;AAEjD,6DAA0C;AAC1C,8DAA2C;AAC3C,6DAA0C;AAC1C,iEAA8C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Request, Response, NextFunction } from "express";
|
|
2
|
-
export declare const errorHandler: (err: Error, req: Request, res: Response, next: NextFunction) =>
|
|
2
|
+
export declare const errorHandler: (err: Error, req: Request, res: Response, next: NextFunction) => Response<any, Record<string, any>> | undefined;
|
|
@@ -4,7 +4,7 @@ exports.errorHandler = void 0;
|
|
|
4
4
|
const custmor_error_1 = require("../errors/custmor-error");
|
|
5
5
|
const errorHandler = (err, req, res, next) => {
|
|
6
6
|
if (err instanceof custmor_error_1.CustomError) {
|
|
7
|
-
res.status(err.statusCode).send({ errors: err.serializeErrors() });
|
|
7
|
+
return res.status(err.statusCode).send({ errors: err.serializeErrors() });
|
|
8
8
|
}
|
|
9
9
|
res.status(400).send({ errors: [{ message: "Something went wrong!!" }] });
|
|
10
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../src/middlewares/error-handler.ts"],"names":[],"mappings":";;;AACA,2DAAsD;AAE/C,MAAM,YAAY,GAAG,CAC1B,GAAU,EACV,GAAY,EACZ,GAAa,EACb,IAAkB,EAClB,EAAE;IACF,IAAI,GAAG,YAAY,2BAAW,EAAE,CAAC;QAC/B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,eAAe,EAAE,EAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../src/middlewares/error-handler.ts"],"names":[],"mappings":";;;AACA,2DAAsD;AAE/C,MAAM,YAAY,GAAG,CAC1B,GAAU,EACV,GAAY,EACZ,GAAa,EACb,IAAkB,EAClB,EAAE;IACF,IAAI,GAAG,YAAY,2BAAW,EAAE,CAAC;QAC/B,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,eAAe,EAAE,EAAC,CAAC,CAAC;IAC3E,CAAC;IACD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC,EAAE,CAAC,CAAC;AAC5E,CAAC,CAAC;AAVW,QAAA,YAAY,gBAUvB"}
|