Hi all,
Would it be possible to extend the catch node to errors not triggered by message processing?
I recently had an Omron installation that was experiencing an error because the PLC was no longer reachable, and I was surprised that I didn't receive a notification.
After investigation, the cause was that the catch node is only triggered if the call to node.error
contains a message.
cc @Steve-Mcl, onClientError
with undefined sequence.
So, as you have realised, the error is generated not in the on
input
handler but by an exteranl async event so there is no msg to include: node-red-contrib-omron-fins/nodes/read.js at master · Steve-Mcl/node-red-contrib-omron-fins · GitHub (though I do try via tags)
It would be good if the catch node could be configured to catch those error without a message too but I have not looked in to what it would take nor considered the consequences (would likely need to be a new catch node option to stay backwards compatible)
If we add an option to allow any error I don't think there will be any unintended consequences.
In the done
section of the Messaging API, node.error
is called with the message, so our only concern is the node.error
call itself. Adding the new option allows to filter which nodes should be triggered.
Another question to discuss is regarding config nodes; do we also allow them? If so, how do we integrate them into the UI? With the 'global config' flow (for global scope)?
For anyone else reading and need to know if an async disconnection or error has occurred in the Omron nodes, they DO update their own status. So while you cannot (currently) catch the async error, you can pick it up via a status node pointed at the Omron node(s).