Skip to content

Commit

Permalink
Avoid crashing by not throwing error
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Arnei committed Feb 1, 2024
1 parent 06eedd5 commit 3af97a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion proxyServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3af97a1

Please sign in to comment.