# It's possible catch error from configuration node?

**URL:** <https://discourse.nodered.org/t/its-possible-catch-error-from-configuration-node/20045>\
**Category:** General\
**Created:** [8 January 2020 12:05 UTC](https://discourse.nodered.org/t/its-possible-catch-error-from-configuration-node/20045 "2020-01-08T12:05:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![VictorStela](https://avatars.discourse-cdn.com/v4/letter/v/439d5e/32.png) [@VictorStela](https://discourse.nodered.org/u/VictorStela)\
**Post date:** [8 January 2020 12:05 UTC](https://discourse.nodered.org/t/its-possible-catch-error-from-configuration-node/20045/1 "2020-01-08T12:05:18Z")

</div>

Hello,

I'm using the pallete node-red-contrib-s7 to collect data from a PLC. The catch and status node don't work properly with this pallete, because the error is caused from the configuration node of the PLC connection.

![Capturar](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e15becb3ad4db36ad1126ca0d5d9f21ecd2c23fc.jpeg)  
 ![Capturar2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/1f0cb412655d62805bcfc332dc3a45337556d0b0.jpeg)

Someone knows how to get the error from configuration nodes?

Thanks!

---

<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:** [8 January 2020 12:18 UTC](https://discourse.nodered.org/t/its-possible-catch-error-from-configuration-node/20045/2 "2020-01-08T12:18:02Z")

</div>

It will depend on how the Config node is logging the error.

See this post for details - [Catch node not finding error](https://discourse.nodered.org/t/catch-node-not-finding-error/20015/4)

---

<div class="post-metadata">

**Author:** ![VictorStela](https://avatars.discourse-cdn.com/v4/letter/v/439d5e/32.png) [@VictorStela](https://discourse.nodered.org/u/VictorStela)\
**Post date:** [8 January 2020 12:54 UTC](https://discourse.nodered.org/t/its-possible-catch-error-from-configuration-node/20045/3 "2020-01-08T12:54:19Z")

</div>

Thanks @knolleary, I will sugest a issue into the pallet github repository.

---

<div class="post-metadata">

**Author:** ![bvmensvoort](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bvmensvoort/32/80540_2.png) [@bvmensvoort](https://discourse.nodered.org/u/bvmensvoort)\
**Post date:** [10 June 2023 12:32 UTC](https://discourse.nodered.org/t/its-possible-catch-error-from-configuration-node/20045/4 "2023-06-10T12:32:17Z")

</div>

Thanks for asking this question. After diving in the code, I have the answer for this. I couldn't find it in the manual, but the mqtt node is useful.

So, what's needed:

Consumer node (eg. mqtt):

- Register this node on node initialization: `node.broker.users[node.id] = node;`
- Deregister this node on close: `node.on("close", () => { delete node.broker.users[node.id]; }`

Broker node (eg. mqtt-broker):

- Make sure `node.users` exists on initialisation: `node.users = {};`
- Log errors using two arguments: `node.error("msg", {})`

Note: `node.warn("msg", {})` will not be catchable, only errors.

---

<div class="post-metadata">

**Author:** ![OriolFM](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/oriolfm/32/30710_2.png) [@OriolFM](https://discourse.nodered.org/u/OriolFM)\
**Post date:** [9 February 2024 16:48 UTC](https://discourse.nodered.org/t/its-possible-catch-error-from-configuration-node/20045/5 "2024-02-09T16:48:51Z")

</div>

I think [they gave you a solution on Github](https://github.com/st-one-io/node-red-contrib-s7/issues/59#issuecomment-603311262): by changing the s7 configuration node to the pertinent flow, you can use a catch node on that flow to handle the errors. You did not reply to them.

I tested it on my own project (I was having the same issue), and it works well.
