How to read debug console line?


I'm using node-red-contrib-ab for reading plc data.
When PLC is disconnected it shows "Failure (Bad values)" in debug field as msg: String[20],
i want to read this message so than i can know the plc is offline.
I have tried with debug node but no luck.

any ideas how to do that



I am not sure I fully understand what you are seeing, could you post a screenshot of the error message.

Does a Catch node catch the error?



Note: also asked on Stack Overflow:

@nsp For the Catch node to work, the node needs to be reporting the errors using the proper API. If you are only getting a log message and nothing from the Catch node, that means the node needs fixing.

However, the node you mention, node-red-contrib-ab has not been updated for 2 years and has no github link associated with it for reporting issues. You would have to contact the author directly to ask if they can make the change.

Alternatively, I see that node is actually an old fork of which is more widely used and actively maintained. You may want to see if you can switch to that module for your particular PLC.



Note: also replied on Stack Overflow:Reply
Thank you, but on the terminal the node prints this message:

[error] [ab endpoint:d9497bf0.558fc8] Failure (Bad values)

is this how the catch node catches error by "[error]" ?



@nsp I'm not going to have this conversation in two places, so if you want to continue beyond this response, either reply here or on SO - not both.

The API docs (which I failed to include a link to here, but did on SO) describes exactly what the node needs to do to log an error for the Catch node to receive it:



Sorry, I missed the link.
Again thanks for your support.