aboutsummaryrefslogtreecommitdiffstats
path: root/slack/task.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2023-02-02 21:53:40 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:53 +0100
commita1c4b14c8f504b39cfadd78a9010c3ed6495e123 (patch)
treef4ad95fdf5eb6d05d27e9f1d36736048a5f4ee54 /slack/task.py
parentb91385fe3d3538704deb06bb187dc48efa87e34b (diff)
downloadwee-slack-a1c4b14c8f504b39cfadd78a9010c3ed6495e123.tar.gz
Record uncaught errors and add command to display them
Diffstat (limited to 'slack/task.py')
-rw-r--r--slack/task.py6
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: