From 15e405162590b2e79dfc32751625f5425613bc52 Mon Sep 17 00:00:00 2001 From: dec0dOS Date: Sun, 9 Oct 2022 16:12:27 +0100 Subject: [PATCH] fix(backend/app.js): fix internal error handler --- backend/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app.js b/backend/app.js index 6e5a3dd..95aeb65 100644 --- a/backend/app.js +++ b/backend/app.js @@ -87,8 +87,8 @@ app.use("/controller", routerController); // other controller-specific routes app.get("*", async function (req, res) { res.status(404).json({ error: "404 Not found" }); }); -app.use(async function (err, req, res) { - console.error(err.stack); // TODO: replace with production logger +app.use(function (err, req, res, next) { + console.error(err.stack); res.status(500).json({ error: "500 Internal server error" }); });