But by COM2 is down or disconnected , an error is displayed in Terminal/Command console : ([error] serial port COM3 error: Error: Error: No such file or directory, cannot open COM3)
But the Error Message above does not mention any flow name / flow id .
Is there a way where we can map the error / uncaught exception with Flow name /Flow id/ Node id?
If you add a Catch node linked to the serial node and feed it into a debug node set to show Complete Message (that is important) what do you see in the debug pane?
I tried the catch approach but since its a uncaught Exception type its not reaching catch node . The debug node attached t0 catch node does not give any data.
It isn't an uncaught exception or it would crash node-red, but you are right that it does not generate an error that can be caught by a Catch node. I don't know you can solve your problem. Perhaps someone else can suggest something.
Hi - not sure I've caught up - but what exactly is the problem ? It says it can't open COM1 - so you need to fix that . Is there some other app already using it ? Is it actually physically there on that machine ? Do you just need to remove the config node that the serial port is using - or edit it to point to a serial port that does exist ?
The issue is not about the serial port connection , we have deliberately disconnected the Serial port . What we need is the error that is getting displayed in command / terminal / error logs Should be trackable with the flow.
For Example -
COM1 is in Flow 1
COM2 is in Flow 2
If COM2 is disconnected , command / terminal / error logs Shows the error COM2 is down or disconnected , but there is no information of flow if or flow name for tracking .
We need it for tracking since we may have 10 flows and 1 flow fails then we need to send the issue to the End User
I think you may be misinterpreting the error. It is not saying that there is nothing connected to the port externally, it is saying that node red cannot connect to the port, so either the serial hardware does not exist or the node red user does not have permission to use it, or something else is already using it.
I think the error will never occur at run time, only when starting node red or deploying. For that reason you cannot catch it in the flow as the flow is not running when the error occurs.
Ya correct @Colin
The error is during load or reload of flow file. So is there a way to print flow id in logs. If i load 10 flow files and one of it has COM2 and COM2 is not connected , then can i get the Flow name or id in the logs