How to handle errors
See original GitHub issueHello,
I’m currently doing a little project using Telegraf and I have a problems handling errors. I have read a lot about it and I have seen some solutions but they are not working.
The code I am having problems with is basically this one:
const bot = new Telegraf(config.telegram.token);
bot.on('message', (ctx) =>
process_message(ctx.message, callback)
);
bot.startPolling();
And, for example, when I open another bot I have this problem, very reported:
Failed to process updates. { Error: 409: Conflict: terminated by other getUpdates request
I have seen that you can use bot.catch(err => console.log(err));
but it’s not working for me. As I know, Telegraf works with promises, so I also tried bot.startPolling().catch(err => console.log(err));
I’m sorry it this have been answered already, as you can see I did some research but nothing is working because I’m missing something.
Thanks a lot.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:23 (8 by maintainers)
And what do you want?
Why don’t I have it? Maybe it’s your environment issue? Check out things like a firewall and so on…