From 36f1b4d5bee9283ede7f08507a290b6a4798dac9 Mon Sep 17 00:00:00 2001 From: Josiah Baldwin Date: Fri, 25 Oct 2024 03:02:53 -0700 Subject: [PATCH] Added global ws error handler (#6475) --- webserver.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webserver.js b/webserver.js index 15e2ee64..53446a6b 100644 --- a/webserver.js +++ b/webserver.js @@ -6334,6 +6334,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF // Handle all incoming web sockets, see if some need to be handled as web relays obj.app.ws('/*', function (ws, req, next) { + // Global error catcher + ws.on('error', function (err) { parent.debug('web', 'GENERAL WSERR: ' + err); console.log(err); }); if ((obj.webRelayRouter != null) && (obj.args.relaydns.indexOf(req.hostname) >= 0)) { handleWebRelayWebSocket(ws, req); return; } return next(); });