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.

Potential Unhandled Exceptions in Perpetual Tasks

See original GitHub issue

The bot often makes use of the pattern of loop.create_task with tasks that are meant to run perpetually. However, there are no provisions for restarting tasks should any exceptions occur in them.

Discord.py’s tasks extension looks promising and that could be used going forward. As an alternative, some wrapper could be created that just logs exceptions and tries again, or using Future.add_done_callback. There are probably more possible approaches.

See discussion in #360 for details on a particular case.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
HassanAbouelelacommented, Dec 13, 2021

I’d suggest you hold off for now. Scheduling is one of the first things being ported to bot-core, and I expect a PR within the next couple days.

1reaction
MarkKozcommented, May 7, 2019

Maybe it’ll be released by the time we’re done moving over to Django.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tasks and Unhandled Exceptions - .NET Parallel Programming
To address this, Tasks keep track of whether an unhandled exception has been “observed.” In this context, “observed” means that code has joined ......
Read more >
How to handle all unhandled exceptions when using Task ...
I'm using the TPL (Task Parallel Library) in .NET 4.0. I want to centralize the handling logic of all unhandled exceptions by using...
Read more >
Licensing error during backup - misleading Error Message
Hello, we're on B&R Update 11a and still facing the error-message "1Processing xxxxxxx Error: Unhandled exception was thrown during ...
Read more >
PyCharm Debugging - Stop on Unhandled Exceptions
To ensure this is set up correctly, go to Run > View Breakpoints (Ctrl + Shift + F8). In the dialog box, ensure...
Read more >
Any way to catch unhandled exceptions within tasks? - Reddit
Solution: The tasks' exceptions can be caught by using the TaskScheduler.UnobservedTaskException, however the "gotcha" is that this will ...
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