We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I've been searching through the docs but I can only find something like "all errors are emitted on the bot object".
How can I catch them? Maybe it's an idea to write a very small sample of error catching so that the process doesn't crash when a network error occurs.
Thanks!
The text was updated successfully, but these errors were encountered:
Yes, errors are emitted as error events on the bot object; you can get them by listening to those events:
error
bot.on("error", (err) => { // TODO });
If you don't register any listeners, Node.JS exits when an error event is emitted.
If you want to catch errors when sending a message, you can do so with the then() method (in which case the event is not emitted at all).
then()
PS: Network errors when retrieving updates are emitted as updateError instead since they're retried.
updateError
Sorry, something went wrong.
No branches or pull requests
I've been searching through the docs but I can only find something like "all errors are emitted on the bot object".
How can I catch them?
Maybe it's an idea to write a very small sample of error catching so that the process doesn't crash when a network error occurs.
Thanks!
The text was updated successfully, but these errors were encountered: