# Error redirection

**URL:** <https://discourse.nodered.org/t/error-redirection/41864>\
**Category:** General\
**Created:** [1 March 2021 22:58 UTC](https://discourse.nodered.org/t/error-redirection/41864 "2021-03-01T22:58:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mxm](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mxm](https://discourse.nodered.org/u/mxm)\
**Post date:** [1 March 2021 22:58 UTC](https://discourse.nodered.org/t/error-redirection/41864/1 "2021-03-01T22:58:51Z")

</div>

I'm using tuya-smart-device to control some bulbs. If the power switch is off the bulb is naturally off and the tuya-smart-device can't connect. That is alright I even capture the status of the node to set proper value of the bulb in another app. However... when tuya-smart-device node cannot establish a connection it generates error that is logged on debug window and since I have couple of such devices debug windows gets pretty messsy.

I'm looking for solution that would allow to keep the debug windos clean. Is there a way to redirect errors from specific node to console or a file instead of displaying in debug window?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [1 March 2021 23:37 UTC](https://discourse.nodered.org/t/error-redirection/41864/2 "2021-03-01T23:37:44Z")

</div>

try adding a catch node. If the tuya-smart-device node is written correctly it should send the error to the catch node (then from there you can chose to send the error to a debug node (or not))

If the catch node fails to catch the error, then you should find the repo / contact the autor / raise an issue on the tuya-smart-device project & request that node.error is called with a 2nd parameter to permit the catch node to catch errors it raises.

---

<div class="post-metadata">

**Author:** ![mxm](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mxm](https://discourse.nodered.org/u/mxm)\
**Post date:** [2 March 2021 12:11 UTC](https://discourse.nodered.org/t/error-redirection/41864/3 "2021-03-02T12:11:58Z")

</div>

> [@Steve-Mcl](#):
>
> he catch node fails to catch the error, then you should find the repo / contact the autor / raise an issue on the tuya-smart-device project & request that node.error is called with a 2nd parameter to permit the catch node to catch errors it raises.

@Steve-Mcl

Thank you for your reply. I indeed tried with catch node and I could not catch the error but since it was the first time to use catch node I was not sure how it should work hence my post here. So indeed it looks like the tuya-smart-defice node does not allow to catch erros so following your advice I've just created issue at repo of the project.

Once again thank you for your reply

---

<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:** [1 May 2021 12:12 UTC](https://discourse.nodered.org/t/error-redirection/41864/4 "2021-05-01T12:12:32Z")

</div>

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