Merge pull request #5263 from hardillb/catch-red-comms-subscribe-error

Catch errors from RED.comms.subscribe callback
This commit is contained in:
Nick O'Leary
2025-10-09 10:07:05 +01:00
committed by GitHub

View File

@@ -116,7 +116,13 @@ RED.comms = (function() {
var subscribers = subscriptions[t];
if (subscribers) {
for (var i=0;i<subscribers.length;i++) {
subscribers[i](msg.topic,msg.data);
try {
subscribers[i](msg.topic,msg.data);
} catch (error) {
// need to decide what to do with this uncaught error
console.warn('Uncaught error from RED.comms.subscribe: ' + err.toString())
console.warn(err)
}
}
}
}