Detecting of stop polling when error in handleUpdates
See original GitHub issueHi, I came across a situation where polling was stopped due to an error in the this.handleUpdates:
fetchUpdates () {
...
.then((updates) => {
throw new Error('Example error'); // For test
return this.handleUpdates(updates).then(() => updates)
})
.catch((err) => {
console.error('Failed to process updates.', err)
this.polling.started = false
this.polling.offset = 0
return []
})
...
}
If an error occurs, it is logged, the polling stops and the bot stops working. And I do not know how to detect this error in order to try to resume the polling or restart the server.
The real error that I had was: error 409: Conflict: terminated by other long poll or webhook
and I could not process it. Are there any ways to handle such errors?
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
long-poll jQuery.ajax() fails to callback after phone sleeps?
I have tried adding a timeout to the ajax settings: timeout: 120 * 1000,. This helps because the error() function is eventually called...
Read more >How to Spot a Poll Bot and Stop Poll Bot Fraud - Anura.io
Another potential reason for poll bot fraud is to sabotage your market research efforts. By spamming your polls with worthless bot replies that ......
Read more >Telegraf: Modern Telegram Bot Framework for Node.js
By default Telegraf will print all errors to stderr and rethrow error. ... stop. Stop Webhook and polling. telegraf.stop([callback]) => Promise ...
Read more >FAQs - Quinnipiac University Poll
Find the answers to questions frequently asked about participation and representation in our polls, how polls are conducted and reported, etc.
Read more >Vote-By-Mail FAQs
If you make a mistake on your mail ballot, contact the Elections Office at ... Voted mail ballots will not be accepted at...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@PsiXdev new release will be available in ~10-15 hours
I also like the idea with
bot stopped callback
. Unfortunately, I’m not sure I can find enough time in the near future. Maybe someone else can help, or I’ll try to tackle the problem a little later.