Catch errors from RED.comms.subscribe callback

fixes #5262
This commit is contained in:
Ben Hardill
2025-09-05 14:25:37 +01:00
parent 9ad329e5a1
commit d35b31cbef

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)
}
}
}
}