# Serial In / Serial request node issue - Error handling

**URL:** <https://discourse.nodered.org/t/serial-in-serial-request-node-issue-error-handling/49208>\
**Category:** Core Development\
**Created:** [2 August 2021 11:40 UTC](https://discourse.nodered.org/t/serial-in-serial-request-node-issue-error-handling/49208 "2021-08-02T11:40:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SS-Akhilesh-Appala](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ss-akhilesh-appala/32/44482_2.png) [@SS-Akhilesh-Appala](https://discourse.nodered.org/u/SS-Akhilesh-Appala)\
**Post date:** [2 August 2021 11:40 UTC](https://discourse.nodered.org/t/serial-in-serial-request-node-issue-error-handling/49208/1 "2021-08-02T11:40:42Z")

</div>

Hi Team  
Is there any way that we can catch the uncaught exceptions from serial in or serial request node  
I have tried using the status node.. but only seeing connected(OK) and timeout as (timeout).  
Is there any way or settings wrapper that I can catch the uncaught exception like (COM2: Access denied , COM2 : File not found) such errors from Java (backend)

In UI, I am able to catch them using loghandler inside the nodered Settings

---

<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:** [2 August 2021 12:51 UTC](https://discourse.nodered.org/t/serial-in-serial-request-node-issue-error-handling/49208/2 "2021-08-02T12:51:28Z")

</div>

Does the catch node not catch them ?

---

<div class="post-metadata">

**Author:** ![SS-Akhilesh-Appala](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ss-akhilesh-appala/32/44482_2.png) [@SS-Akhilesh-Appala](https://discourse.nodered.org/u/SS-Akhilesh-Appala)\
**Post date:** [2 August 2021 15:43 UTC](https://discourse.nodered.org/t/serial-in-serial-request-node-issue-error-handling/49208/3 "2021-08-02T15:43:30Z")

</div>

Nope, the Catch node is not able to identify those errors as they are called as uncaught exceptions.

---

<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:** [2 August 2021 16:32 UTC](https://discourse.nodered.org/t/serial-in-serial-request-node-issue-error-handling/49208/4 "2021-08-02T16:32:18Z")

</div>

> [@SS-Akhilesh-Appala](#):
>
> they are called as uncaught exceptions

Do you mean that they crash node red?

Can you stop node-red and then restart it in a terminal and post the log from startup to the error please.

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [2 August 2021 16:45 UTC](https://discourse.nodered.org/t/serial-in-serial-request-node-issue-error-handling/49208/5 "2021-08-02T16:45:51Z")

</div>

The catch node only gets triggered when `node.error()` is called with a message as second parameter, meaning they had to be part of a running flow. If the serial port can't be set up in the first place, you will only see error messages in the log.

Correct me, if I'm wrong... I did a quick sweep over the code, error handling looks fine, but those are logged as errors only. Unfortunately, you can't catch them in a flow. 😅

---

<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:** [2 August 2021 20:21 UTC](https://discourse.nodered.org/t/serial-in-serial-request-node-issue-error-handling/49208/6 "2021-08-02T20:21:57Z")

</div>

> [@SS-Akhilesh-Appala](#):
>
> can catch the uncaught exception like (COM2: Access denied , COM2 : File not found)

When do those errors occur? I suspect they occur before the flows are started, so it is therefore not possible to catch them within a flow.

---

<div class="post-metadata">

**Author:** ![SS-Akhilesh-Appala](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ss-akhilesh-appala/32/44482_2.png) [@SS-Akhilesh-Appala](https://discourse.nodered.org/u/SS-Akhilesh-Appala)\
**Post date:** [3 August 2021 09:34 UTC](https://discourse.nodered.org/t/serial-in-serial-request-node-issue-error-handling/49208/7 "2021-08-03T09:34:36Z")

</div>

yes @kuema , what you posted is correct we are seeing those error msgs in the logs in debug mode.  
But we are not able to catch them through the backend. Need to check whether any other way to find those logs from java.

---

<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:** [2 October 2021 09:35 UTC](https://discourse.nodered.org/t/serial-in-serial-request-node-issue-error-handling/49208/8 "2021-10-02T09:35:31Z")

</div>

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