Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send message error handling #142

Closed
DarkPark opened this issue Nov 13, 2020 · 17 comments
Closed

send message error handling #142

DarkPark opened this issue Nov 13, 2020 · 17 comments

Comments

@DarkPark
Copy link

Is there a way to handle errors in the Sender Node?
The catch node is not triggered and Sender Node is not producing any payload.
Please advise.

@windkh
Copy link
Owner

windkh commented Nov 13, 2020

I guess this issue is a duplicate

@windkh
Copy link
Owner

windkh commented Nov 13, 2020

I need to find a way to handle this... the output of the sender node contains the result. But there couldcalso be a timeout....

@DarkPark
Copy link
Author

I'm not familiar with node-red internals but maybe it's possible to just throw an exception (and let catch node handle it) and skip payload?

@windkh
Copy link
Owner

windkh commented Nov 13, 2020

I will try

@windkh
Copy link
Owner

windkh commented Nov 29, 2020

fixed in version 8.9.9

@windkh windkh closed this as completed Nov 29, 2020
@windkh
Copy link
Owner

windkh commented Nov 29, 2020

A message containing the exception and the causing message object is printed using node.error.

@windkh
Copy link
Owner

windkh commented Nov 29, 2020

I could add a second output which would be triggered in case of an exception. So the question is if you want to handle the error in the sender on your own or if you would like to abort the whole flow?
So please let me know your use case.

@DarkPark
Copy link
Author

Thank you. Will test it.
I'm okay with any of these solutions as I have a separate subflow to send messages (it encapsulates all sending logic).
But in general (especially when there are many send nodes) it is probably better to throw an exception to one catch node.

@windkh
Copy link
Owner

windkh commented Nov 29, 2020

Then I will implement an optional second output

@windkh windkh reopened this Nov 29, 2020
@windkh
Copy link
Owner

windkh commented Nov 29, 2020

Please check version 8.9.1
TelegramBotErrorHandling

@windkh windkh closed this as completed Nov 29, 2020
@DarkPark
Copy link
Author

I'm testing with empty content and unfortunately neither second output nor catch node is triggered.

@windkh
Copy link
Owner

windkh commented Nov 30, 2020

That is ok

@DarkPark
Copy link
Author

But the message was not sent. It's not a normal situation and it would be nice to be able to react.

Besides I see that the second output has data even when there are no errors.

@windkh
Copy link
Owner

windkh commented Nov 30, 2020

Right now empty content is ignored... no content = nothing to send. The 2nd output should not send anything. I will check that

@windkh windkh reopened this Nov 30, 2020
@windkh
Copy link
Owner

windkh commented Nov 30, 2020

Besides I see that the second output has data even when there are no errors.

@DarkPark I can not reproduce that. On my machine only one output is triggered. Can you please recheck?

@windkh
Copy link
Owner

windkh commented Nov 30, 2020

But the message was not sent. It's not a normal situation and it would be nice to be able to react.

A warning is issued in this case. I don't dare to change that behavior to not break existing bots.

@windkh windkh closed this as completed Nov 30, 2020
@DarkPark
Copy link
Author

I'm very sorry but can't reproduce it either.
Thank you for your work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants