From dfeb30a57d8b42e1bec323efda63444e9a5d2269 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sun, 16 Jun 2024 22:17:01 +0200 Subject: [PATCH] server: Print backtraces for errors in UDP handler This applies to errors in e.g. the oscInFilter defined by a custom plugin module. Previously, just the exception backtrace was shown, without any indication of the exception type or where the error occurred, e.g.: (ERROR, UDP) links is not defined With this commit, the full exception including backtrace is printed, making debugging a lot easier, e.g.: (ERROR, UDP) ReferenceError: links is not defined at CustomModule.oscInFilter (/app/custom-module.js:221:83) at OscServer.oscInFilter (/open-stage-control/app/server/src/server/osc/index.js:148:1) at OscServer.oscInHandler (/open-stage-control/app/server/src/server/osc/index.js:162:1) at OscServer.oscInHandlerWrapper (/open-stage-control/app/server/src/server/osc/index.js:174:1) at osc.UDPPort.emit (node:events:394:28) at Object.osc.firePacketEvents (/open-stage-control/app/server/node_modules/osc/src/osc-transports.js:25:1) at osc.UDPPort.p.decodeOSC (/open-stage-control/app/server/node_modules/osc/src/osc-transports.js:85:1) --- src/server/osc/udp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/osc/udp.js b/src/server/osc/udp.js index f819ea5a..9175b885 100644 --- a/src/server/osc/udp.js +++ b/src/server/osc/udp.js @@ -14,7 +14,7 @@ oscUDPServer.on('error', function(e) { if (e.code === 'EADDRINUSE') { console.error(`(ERROR, UDP) could not open port ${oscInPort} (already in use) `) } else { - console.error(`(ERROR, UDP) ${e.message}`) + console.error('(ERROR, UDP)', e) } })