From 3af97a11dcba5cdafa0eda8a4db7cebe2bb2f970 Mon Sep 17 00:00:00 2001 From: Arnei Date: Thu, 1 Feb 2024 15:50:45 +0100 Subject: [PATCH] Avoid crashing by not throwing error Potentially controversial fix intended to keep nodemon from crashing. Instead of having the proxy server throw certain kinds of errors, this changes it to merely logging them. The throwing in and of itself is likely not the root cause of the nodemon crashing issue, but removing it seems to alleviate the issue nonetheless. I'm not certain on what we should ideally do with the kinds of errors that were previously thrown in the first place though. --- proxyServer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxyServer.js b/proxyServer.js index 168113770f..5a5bde6ffb 100644 --- a/proxyServer.js +++ b/proxyServer.js @@ -68,7 +68,8 @@ app.use('', (req, res, next) => { let onReadFromBackend = function (error, response, body) { if (error && (typeof error != 'object' || !error.hasOwnProperty('statusCode') || !error.hasOwnProperty('body'))) { - throw error; + console.error(error); + return; } // forward to client