From 92e2d0d091817a14a2c472c9dbbd52c7a9c14221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20M=C3=A4ckelmann?= <6890706+n1kPLV@users.noreply.github.com> Date: Thu, 7 Sep 2023 11:50:06 +0200 Subject: [PATCH] Re-enable the default express exception handler --- Server/src/utils/please_dont_crash.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Server/src/utils/please_dont_crash.ts b/Server/src/utils/please_dont_crash.ts index 94d84441..22a96aa7 100644 --- a/Server/src/utils/please_dont_crash.ts +++ b/Server/src/utils/please_dont_crash.ts @@ -11,7 +11,9 @@ import { logger } from "./logger" export default function please_dont_crash(cb: (req: Request, res: Response, next: NextFunction) => Promise) { return (req: Request, res: Response, next: NextFunction) => cb(req, res, next).catch(err => { + // log the error logger.error(err) - next() + // and give that error to the next expressjs error handler + next(err) }) }