From fce06f3e07e77e221696c74b77a4fd8d27b2991c Mon Sep 17 00:00:00 2001 From: Wouter Smeenk Date: Thu, 27 Mar 2025 10:35:56 +0100 Subject: [PATCH] Add next(error) in returnErrorMiddleware This makes it possible to add other custom error handlers. --- lib/server/error.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/server/error.js b/lib/server/error.js index eaeef9f9..8eb1b48b 100644 --- a/lib/server/error.js +++ b/lib/server/error.js @@ -37,6 +37,8 @@ const returnErrorMiddleware = (error, req, res, next) => { // Set and return response res.status(statusCode).json({ statusCode, message, stack }); + + next(error); }; export default (app) => {