# Node.error - catch

**URL:** <https://discourse.nodered.org/t/node-error-catch/76526>\
**Category:** General\
**Tags:** debugging, function-node\
**Created:** [13 March 2023 21:51 UTC](https://discourse.nodered.org/t/node-error-catch/76526 "2023-03-13T21:51:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpatel2016](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dpatel2016/32/33730_2.png) [@dpatel2016](https://discourse.nodered.org/u/dpatel2016)\
**Post date:** [13 March 2023 21:51 UTC](https://discourse.nodered.org/t/node-error-catch/76526/1 "2023-03-13T21:51:52Z")

</div>

I am using a node red pccc library and it has an error that I want to read. How do I read the node.error(RED.\_("pccc.error.badvalues")) in the editor?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/9/29ffd59bd2571b20aa9e6fb13dd8f79c217f9caa.jpeg)

---

<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:** [13 March 2023 21:57 UTC](https://discourse.nodered.org/t/node-error-catch/76526/2 "2023-03-13T21:57:58Z")

</div>

That type of error cannot be caught in a flow - it only gets logged.

If make the error catchable, the call to `node.error()` needs to be updated to pass a message object as a second argument to the function.

---

<div class="post-metadata">

**Author:** ![dpatel2016](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dpatel2016/32/33730_2.png) [@dpatel2016](https://discourse.nodered.org/u/dpatel2016)\
**Post date:** [13 March 2023 23:06 UTC](https://discourse.nodered.org/t/node-error-catch/76526/3 "2023-03-13T23:06:54Z")

</div>

If I change the code to

node.error(RED.\_("pccc.error.badvalues"), “Error Connecting”)

Will that work?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 May 2023 23:07 UTC](https://discourse.nodered.org/t/node-error-catch/76526/4 "2023-05-12T23:07:29Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
