diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-02-02 21:53:40 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:53 +0100 |
commit | a1c4b14c8f504b39cfadd78a9010c3ed6495e123 (patch) | |
tree | f4ad95fdf5eb6d05d27e9f1d36736048a5f4ee54 /slack/task.py | |
parent | b91385fe3d3538704deb06bb187dc48efa87e34b (diff) | |
download | wee-slack-a1c4b14c8f504b39cfadd78a9010c3ed6495e123.tar.gz |
Record uncaught errors and add command to display them
Diffstat (limited to 'slack/task.py')
-rw-r--r-- | slack/task.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/slack/task.py b/slack/task.py index b812387..3fafa2e 100644 --- a/slack/task.py +++ b/slack/task.py @@ -20,7 +20,7 @@ from uuid import uuid4 import weechat -from slack.error import format_exception +from slack.error import store_and_format_exception from slack.log import print_error from slack.shared import shared from slack.util import get_callback_name @@ -212,7 +212,7 @@ def task_runner(task: Task[Any]): if not task.exception_read(): print_error( f"{task} was never awaited and failed with: " - f"{format_exception(exception)}" + f"{store_and_format_exception(exception)}" ) failed_tasks.clear() @@ -226,7 +226,7 @@ def create_task(coroutine: Coroutine[Future[Any], Any, T]) -> Task[T]: def _async_task_done(task: Task[object]): exception = task.exception() if exception: - print_error(f"{task} failed with: {format_exception(exception)}") + print_error(f"{task} failed with: {store_and_format_exception(exception)}") def run_async(coroutine: Coroutine[Future[Any], Any, Any]) -> None: |