# Catch node not finding error

**URL:** <https://discourse.nodered.org/t/catch-node-not-finding-error/20015>\
**Category:** General\
**Created:** [7 January 2020 15:50 UTC](https://discourse.nodered.org/t/catch-node-not-finding-error/20015 "2020-01-07T15:50:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dave/32/10827_2.png) [@Dave](https://discourse.nodered.org/u/Dave)\
**Post date:** [7 January 2020 15:50 UTC](https://discourse.nodered.org/t/catch-node-not-finding-error/20015/1 "2020-01-07T15:50:11Z")

</div>

I have a i2c node which monitors a the state of a battery's charge in one of my flows it works fine however if I disconnect the battery, as expected I get an error:

raspberrypi Node-RED[340]: 7 Jan 15:23:28 - [error] [i2c in:Batt %] Error: , Remote I/O error

I want to catch that error and prevent the inject node from activating the flow with i2c node in it, but the catch node does not catch the error, I set the catch node to catch all and also tried catching error from the i2c node generating the error but I get nothing on the catch node output.

why ? is there something i am missing ?

I also tried a status node pointing at the i2c node but I just get the following whether theirs a error or not.

object  
status: object  
source: object  
id: "ee9238a9.5db1b8"  
type: "i2c in"  
name: "Batt %"  
\_msgid: "4b141956.7424c8"

please advise thanks

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [7 January 2020 15:56 UTC](https://discourse.nodered.org/t/catch-node-not-finding-error/20015/2 "2020-01-07T15:56:50Z")

</div>

1. where do you see that error? in the debug sidebar?
2. is the `catch` node on the same tab?
3. did you try selecting - in the `catch` node, the i2c node?

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dave/32/10827_2.png) [@Dave](https://discourse.nodered.org/u/Dave)\
**Post date:** [7 January 2020 16:10 UTC](https://discourse.nodered.org/t/catch-node-not-finding-error/20015/3 "2020-01-07T16:10:12Z")

</div>

1. yes in the side bar & on the console
2. yes same tab ( its a separate tab with just the one flow)
3. yes tried catch all and also just the i2c node

---

<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:** [7 January 2020 16:21 UTC](https://discourse.nodered.org/t/catch-node-not-finding-error/20015/4 "2020-01-07T16:21:52Z")

</div>

Hi @Dave

the Catch node is only able to catch errors that have been logged in a particular way by the node.

Assuming you are using `node-red-contrib-i2c`, you can see how it logs errors in the file here: [https://github.com/nielsnl68/node-red-contrib-i2c/blob/master/i2c/26-i2c.js](https://github.com/nielsnl68/node-red-contrib-i2c/blob/master/i2c/26-i2c.js)

If you search for `node.error` in that file you will see in some places the node calls it with one argument, and in some cases with two. The Catch node will only handle the calls to `node.error()` with two arguments - as the second argument is the message object for the Catch node.

Without a fix to the node, you won't be able to handle those errors in your flow.

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dave/32/10827_2.png) [@Dave](https://discourse.nodered.org/u/Dave)\
**Post date:** [7 January 2020 17:41 UTC](https://discourse.nodered.org/t/catch-node-not-finding-error/20015/5 "2020-01-07T17:41:52Z")

</div>

OK fixed that and it now works thanks for your help.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [7 January 2020 17:52 UTC](https://discourse.nodered.org/t/catch-node-not-finding-error/20015/6 "2020-01-07T17:52:01Z")

</div>

Wasn't the Solution provided by **knolleary** in post #4?

![solved](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/3f6009f97cf0f00cfbf632163231f03498a58992.jpeg)

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dave/32/10827_2.png) [@Dave](https://discourse.nodered.org/u/Dave)\
**Post date:** [7 January 2020 18:06 UTC](https://discourse.nodered.org/t/catch-node-not-finding-error/20015/7 "2020-01-07T18:06:54Z")

</div>

oh looks like I got caught by the solution police, well I was just confirming that the suggested fix by **knolleary** in post #4 was actually the solution to issue raised and as he didn't mark his post as the solution I thought it was appropriate that I did to close off the post.

Clearly you think that its not appropriate, but to be honest I don't care, because the fix kindly offered by **knolleary** in post #4 resolved my problem.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [7 January 2020 18:09 UTC](https://discourse.nodered.org/t/catch-node-not-finding-error/20015/8 "2020-01-07T18:09:15Z")

</div>

Either way - hopefully it will get fed back as an issue to the original project ?
