# Catch error message

**URL:** <https://discourse.nodered.org/t/catch-error-message/81070>\
**Category:** General\
**Created:** [6 September 2023 06:19 UTC](https://discourse.nodered.org/t/catch-error-message/81070 "2023-09-06T06:19:19Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![khfischbach](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/khfischbach/32/16627_2.png) [@khfischbach](https://discourse.nodered.org/u/khfischbach)\
**Post date:** [6 September 2023 06:19 UTC](https://discourse.nodered.org/t/catch-error-message/81070/1 "2023-09-06T06:19:19Z")

</div>

Hi,  
I have received this message from a node:

```auto
6.9.2023, 08:15:44node: xxx
msg : string[30]
"No Services response received."

```

This seems to be not an msg-object, but a simple string.  
All nodes I know, like change, work only on msg-objects. I am not very much familiar with function-node, but what I so far experience also this node cannot handle the simple msg-string - but I am not sure about that.

So I would like to get some help how to catch this message to process it and e.g. place it to the dashboard or some other output.

---

<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:** [6 September 2023 06:48 UTC](https://discourse.nodered.org/t/catch-error-message/81070/2 "2023-09-06T06:48:02Z")

</div>

Indeed, that is not good. What node sent that ? It should be fixed to send a proper error.

---

<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:** [6 September 2023 06:51 UTC](https://discourse.nodered.org/t/catch-error-message/81070/3 "2023-09-06T06:51:09Z")

</div>

Is the node xxx a debug node? If not then what is it?

Have you tried using a Catch node?

---

<div class="post-metadata">

**Author:** ![khfischbach](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/khfischbach/32/16627_2.png) [@khfischbach](https://discourse.nodered.org/u/khfischbach)\
**Post date:** [6 September 2023 06:53 UTC](https://discourse.nodered.org/t/catch-error-message/81070/4 "2023-09-06T06:53:07Z")

</div>

no, it is a FRITZ!Box-node.  
I have tried catch but I did not see any result from this.

Upate:  
The FRITZ!Box is connected via VPN. So sometimes the connection gets lost. The VPN naturally is configured to catch up and reestablish the connection.  
But it looks like I  
a) either have to update manualle the related configuration-node  
b) wait some time until the configuration-node reestablishes the connection and works again.

Meanwhile, when accessing the node, this message is issued. So I would like to catch that and show an own error message somewhere.

---

<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:** [6 September 2023 07:21 UTC](https://discourse.nodered.org/t/catch-error-message/81070/5 "2023-09-06T07:21:02Z")

</div>

Try a function node set to check if the msg is a string and then change it. Either move to payload, maybe on a second output, or create a proper error.

---

<div class="post-metadata">

**Author:** ![khfischbach](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/khfischbach/32/16627_2.png) [@khfischbach](https://discourse.nodered.org/u/khfischbach)\
**Post date:** [6 September 2023 07:30 UTC](https://discourse.nodered.org/t/catch-error-message/81070/6 "2023-09-06T07:30:03Z")

</div>

I have tried this already. I am not very much familiar with function-node (or JAVASCRIPT).  
Anyhow - I found out, the FRITZ!Box node stops the message flow after this error message. So the message is not passed to the function-node. Bad luck!

P.S.: I have opened an issue at node-red-contrib-fritz.

---

<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:** [6 September 2023 07:51 UTC](https://discourse.nodered.org/t/catch-error-message/81070/7 "2023-09-06T07:51:12Z")

</div>

I don't think the string is in a message passed on, I think it is an error message that appears in the debug pane directly.

@khfischbach can you confirm that if you have a debug node on the output of the Fritz node that it does not show anything when the error is received?

---

<div class="post-metadata">

**Author:** ![khfischbach](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/khfischbach/32/16627_2.png) [@khfischbach](https://discourse.nodered.org/u/khfischbach)\
**Post date:** [6 September 2023 08:11 UTC](https://discourse.nodered.org/t/catch-error-message/81070/8 "2023-09-06T08:11:35Z")

</div>

confirmed

---

<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:** [6 September 2023 09:18 UTC](https://discourse.nodered.org/t/catch-error-message/81070/9 "2023-09-06T09:18:20Z")

</div>

I see someone else (or is it you) has submitted a [bug report](https://github.com/bashGroup/node-red-contrib-fritz/issues/126), though it looks as if support may be minimal, looking at the outstanding bugs there.

> [@khfischbach](#):
>
> b) wait some time until the configuration-node reestablishes the connection and works again.

Do you mean it does recover by itself when the connection is re-established? So the issue is just that you want notification of it?

While it is in the failed state do you get any output from the node when you send it a message? If not then you can easily detect that by using a trigger node which receives the same input as the fritz, configure it to Send Nothing, Wait an appropriate time and then Send an error message. Send it a Reset message every time an output is sent by the fritz node.

---

<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:** [6 September 2023 09:37 UTC](https://discourse.nodered.org/t/catch-error-message/81070/10 "2023-09-06T09:37:44Z")

</div>

Alternatively you could use a Ping node every 30 seconds (or whatever is appropriate) to check the box is accessible, and use that to display the error.

---

<div class="post-metadata">

**Author:** ![khfischbach](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/khfischbach/32/16627_2.png) [@khfischbach](https://discourse.nodered.org/u/khfischbach)\
**Post date:** [6 September 2023 09:49 UTC](https://discourse.nodered.org/t/catch-error-message/81070/11 "2023-09-06T09:49:42Z")

</div>

yes, it was me who issued the bug report on github. I have also noticed the code has not been updated recently. So I am not sure if or when it will get reviewed.

Yes, I expierience that, after some time, it recovered.

No, I don't get any output when it fails. The attached debug-node does not show anything in this situation, exept the error message I reported, but via the console and not via the debug-node!

---

<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:** [6 September 2023 13:03 UTC](https://discourse.nodered.org/t/catch-error-message/81070/12 "2023-09-06T13:03:27Z")

</div>

Does my suggestion of using a Trigger or Ping node do what you need?

---

<div class="post-metadata">

**Author:** ![khfischbach](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/khfischbach/32/16627_2.png) [@khfischbach](https://discourse.nodered.org/u/khfischbach)\
**Post date:** [6 September 2023 13:13 UTC](https://discourse.nodered.org/t/catch-error-message/81070/13 "2023-09-06T13:13:10Z")

</div>

not tried yet!  
Not sure if this will bring the solution.  
In my case, the trigger to access the FRITZ!Box-node is some command from my mobile via TELEGRAM Bot. I only will face the problem when issuing a command and no reply will come.

I could use a trigger to find out if internet is down. But my experience is, that internet is very much stable. So if connection to the FRITZ!Box is down, it only is down for the FRITZ!Box-node (why ever). Except some downtime of the VPN.

In fact, I do have two FRITZ!Box. One on the LAN and one via VPN. The problem occurs on both. More often on the one connected via VPN, but anyhow.

So the trigger is a workaround, but might not even catch the point when it happens.

The very much better would be a "correct" error message from the FRITZ!Box-node. Will see if the bug report I issued bring some results.

---

<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:** [6 September 2023 13:59 UTC](https://discourse.nodered.org/t/catch-error-message/81070/14 "2023-09-06T13:59:37Z")

</div>

> [@khfischbach](#):
>
> I only will face the problem when issuing a command and no reply will come.

Which is exactly what my suggestion using a Trigger node will detect. It will detect that you have sent a message to the Fritz node and it has not replied within a certain time.

---

<div class="post-metadata">

**Author:** ![khfischbach](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/khfischbach/32/16627_2.png) [@khfischbach](https://discourse.nodered.org/u/khfischbach)\
**Post date:** [6 September 2023 14:33 UTC](https://discourse.nodered.org/t/catch-error-message/81070/15 "2023-09-06T14:33:21Z")

</div>

I will have a look at the trigger-node. I am currently not familiar with that. Thanks for the hint!

---

<div class="post-metadata">

**Author:** ![khfischbach](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/khfischbach/32/16627_2.png) [@khfischbach](https://discourse.nodered.org/u/khfischbach)\
**Post date:** [7 September 2023 07:07 UTC](https://discourse.nodered.org/t/catch-error-message/81070/16 "2023-09-07T07:07:22Z")

</div>

I can confirm, the trigger-node seems to be a valid workaround. It took me some time to understand how it is working and configure it the way it supports the required flow, but looks like it works.  
Thanks for the hint.

Anyhow, it is a workaround! Will see wheather the bug report will get a result.

---

<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:** [21 September 2023 07:07 UTC](https://discourse.nodered.org/t/catch-error-message/81070/17 "2023-09-21T07:07:32Z")

</div>

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