From 3ca3aa014dc2d96120a80200d3e67341ccf9bb1c Mon Sep 17 00:00:00 2001 From: khavinshankar Date: Fri, 1 Dec 2023 20:46:59 +0530 Subject: [PATCH] fix error handler --- src/middleware/errorHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/middleware/errorHandler.ts b/src/middleware/errorHandler.ts index be485e6..0e08ce1 100644 --- a/src/middleware/errorHandler.ts +++ b/src/middleware/errorHandler.ts @@ -18,7 +18,7 @@ const sendProdError = (err: any, res: Response) => { }); }; -export const errorHandler: ErrorRequestHandler = (err, req, res) => { +export const errorHandler: ErrorRequestHandler = (err, req, res, next) => { err.statusCode = err.statusCode || 500; err.status = err.status || "error";