Catch error message

Hi,
I have received this message from a node:

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.

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

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

Have you tried using a Catch node?

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.

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.

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.

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?

confirmed

I see someone else (or is it you) has submitted a bug report, though it looks as if support may be minimal, looking at the outstanding bugs there.

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.

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.

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!

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

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.

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.

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

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.

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