mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
fix: Task manager exception handling (#3839)
* Raise exception from closures in run_in_background using run_on_main * Add author to CONTRIBUTORS file * Undo taskman changes * Raise exceptions from _on_closures_pending using singleShot
This commit is contained in:
parent
b75f2798e6
commit
d8460d354a
2 changed files with 9 additions and 1 deletions
|
@ -213,6 +213,7 @@ GithubAnon0000 <GithubAnon0000@users.noreply.github.com>
|
|||
Mike Hardy <github@mikehardy.net>
|
||||
Danika_Dakika <https://github.com/Danika-Dakika>
|
||||
Mumtaz Hajjo Alrifai <mumtazrifai@protonmail.com>
|
||||
Jakub Fidler <jakub.fidler@protonmail.com>
|
||||
|
||||
********************
|
||||
|
||||
|
|
|
@ -144,4 +144,11 @@ class TaskManager(QObject):
|
|||
self._closures = []
|
||||
|
||||
for closure in closures:
|
||||
try:
|
||||
closure()
|
||||
except Exception as e:
|
||||
|
||||
def raise_exception(exception=e) -> None:
|
||||
raise exception
|
||||
|
||||
QTimer.singleShot(0, raise_exception)
|
||||
|
|
Loading…
Reference in a new issue