question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Detecting of stop polling when error in handleUpdates

See original GitHub issue

Hi, 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:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dotcypresscommented, Dec 1, 2017

@PsiXdev new release will be available in ~10-15 hours

1reaction
psixdevcommented, Nov 30, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found