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:
Jakub Fidler 2025-03-10 08:17:50 +01:00 committed by GitHub
parent b75f2798e6
commit d8460d354a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -213,6 +213,7 @@ GithubAnon0000 <GithubAnon0000@users.noreply.github.com>
Mike Hardy <github@mikehardy.net> Mike Hardy <github@mikehardy.net>
Danika_Dakika <https://github.com/Danika-Dakika> Danika_Dakika <https://github.com/Danika-Dakika>
Mumtaz Hajjo Alrifai <mumtazrifai@protonmail.com> Mumtaz Hajjo Alrifai <mumtazrifai@protonmail.com>
Jakub Fidler <jakub.fidler@protonmail.com>
******************** ********************

View file

@ -144,4 +144,11 @@ class TaskManager(QObject):
self._closures = [] self._closures = []
for closure in closures: for closure in closures:
closure() try:
closure()
except Exception as e:
def raise_exception(exception=e) -> None:
raise exception
QTimer.singleShot(0, raise_exception)