From 51e871da965ce1778b91490ae2cc3f4f320e894c Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Fri, 14 Apr 2023 08:59:27 +0200 Subject: [PATCH] fix: 4 param error handler (#3520) --- src/lib/middleware/catch-all-error-handler.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/middleware/catch-all-error-handler.ts b/src/lib/middleware/catch-all-error-handler.ts index 3b8c18b4c5..a29538ac70 100644 --- a/src/lib/middleware/catch-all-error-handler.ts +++ b/src/lib/middleware/catch-all-error-handler.ts @@ -6,7 +6,9 @@ export const catchAllErrorHandler = ( logProvider: LogProvider, ): ErrorRequestHandler => { const logger = logProvider('/debug-error-handler.ts'); - return (err, req, res) => { + // should not remove next as express needs 4 parameters to distinguish error handler from regular handler + /* eslint-disable @typescript-eslint/no-unused-vars */ + return (err, req, res, next) => { handleErrors(res, logger, err); }; };