# How to read debug console line?

**URL:** <https://discourse.nodered.org/t/how-to-read-debug-console-line/2530>\
**Category:** General\
**Created:** [24 August 2018 06:39 UTC](https://discourse.nodered.org/t/how-to-read-debug-console-line/2530 "2018-08-24T06:39:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nsp](https://avatars.discourse-cdn.com/v4/letter/n/278dde/32.png) [@nsp](https://discourse.nodered.org/u/nsp)\
**Post date:** [24 August 2018 06:39 UTC](https://discourse.nodered.org/t/how-to-read-debug-console-line/2530/1 "2018-08-24T06:39:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [24 August 2018 08:35 UTC](https://discourse.nodered.org/t/how-to-read-debug-console-line/2530/2 "2018-08-24T08:35:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [24 August 2018 08:43 UTC](https://discourse.nodered.org/t/how-to-read-debug-console-line/2530/3 "2018-08-24T08:43:15Z")

</div>

Note: also asked on Stack Overflow: [https://stackoverflow.com/questions/51999057/node-red-catching-error-node-red-contrib-ab](https://stackoverflow.com/questions/51999057/node-red-catching-error-node-red-contrib-ab)

@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](https://www.npmjs.com/package/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 [https://www.npmjs.com/package/node-red-contrib-s7](https://www.npmjs.com/package/node-red-contrib-s7) which is more widely used and actively maintained. You may want to see if you can switch to that module for your particular PLC.

---

<div class="post-metadata">

**Author:** ![nsp](https://avatars.discourse-cdn.com/v4/letter/n/278dde/32.png) [@nsp](https://discourse.nodered.org/u/nsp)\
**Post date:** [24 August 2018 09:03 UTC](https://discourse.nodered.org/t/how-to-read-debug-console-line/2530/4 "2018-08-24T09:03:41Z")

</div>

Note: also replied on Stack Overflow:[Reply](https://stackoverflow.com/questions/51999057/node-red-catching-error-node-red-contrib-ab/52000644#52000644)  
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]" ?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [24 August 2018 09:11 UTC](https://discourse.nodered.org/t/how-to-read-debug-console-line/2530/5 "2018-08-24T09:11:54Z")

</div>

@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: [https://nodered.org/docs/creating-nodes/node-js#handling-errors](https://nodered.org/docs/creating-nodes/node-js#handling-errors)

---

<div class="post-metadata">

**Author:** ![nsp](https://avatars.discourse-cdn.com/v4/letter/n/278dde/32.png) [@nsp](https://discourse.nodered.org/u/nsp)\
**Post date:** [24 August 2018 09:14 UTC](https://discourse.nodered.org/t/how-to-read-debug-console-line/2530/6 "2018-08-24T09:14:16Z")

</div>

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