aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/QtAsyncio/events.py
diff options
context:
space:
mode:
authorLoan Guilbaud <guilbaudl.dev@gmail.com>2025-02-27 22:04:44 +0100
committerLoan Guilbaud <guilbaudl.dev@gmail.com>2025-03-04 11:40:33 +0100
commitc253dcda92cc2efb45197190beaccb926afb120c (patch)
treea11d78340886b5ec0b355f3578ce693964673983 /sources/pyside6/PySide6/QtAsyncio/events.py
parent934e4db8ea95843f1585c81b28613c97eca7e2ce (diff)
QtAsyncio: Improve logging when an Exception occurs in a task
When an exception occurs in a task, the logging is not helpful since it prints out nothing specific about the error that occurred. Catching the traceback and printing it out with the task in which it happened brings a lot of details to resolve the exception faster. Task-number: PYSIDE-3001 Pick-to: 6.8 Change-Id: If199da28a37406779ac5bec178fe756d1757b08c Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/PySide6/QtAsyncio/events.py')
-rw-r--r--sources/pyside6/PySide6/QtAsyncio/events.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/sources/pyside6/PySide6/QtAsyncio/events.py b/sources/pyside6/PySide6/QtAsyncio/events.py
index 36c7fea97..f99b601f7 100644
--- a/sources/pyside6/PySide6/QtAsyncio/events.py
+++ b/sources/pyside6/PySide6/QtAsyncio/events.py
@@ -598,7 +598,9 @@ class QAsyncioEventLoop(asyncio.BaseEventLoop, QObject):
def default_exception_handler(self, context: dict[str, Any]) -> None:
# TODO
if context["message"]:
- print(context["message"])
+ print(f"{context["message"]} from task {context["task"]._name},"+
+ "read the following traceback:")
+ print(context["traceback"])
def call_exception_handler(self, context: dict[str, Any]) -> None:
if self._exception_handler is not None: