diff options
author | 2020-02-25 22:23:07 -0800 | |
---|---|---|
committer | 2020-02-25 22:25:22 -0800 | |
commit | 47b645a2cd2622709c57158d788554544579d870 (patch) | |
tree | d8c34d1ccde94870ae4c3ef9389179a0f80028ce | |
parent | Scheduler: only delete the task in the done callback if tasks are same (diff) |
Scheduler: properly raise task's exception the done callback
Task.exception() only returns the exception. It still needs to be
explicitly raised.
-rw-r--r-- | bot/utils/scheduling.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bot/utils/scheduling.py b/bot/utils/scheduling.py index 58bb32e5d..742133f02 100644 --- a/bot/utils/scheduling.py +++ b/bot/utils/scheduling.py @@ -94,4 +94,7 @@ class Scheduler(metaclass=CogABCMeta): ) with contextlib.suppress(asyncio.CancelledError): - done_task.exception() + exception = done_task.exception() + # Raise the exception if one exists. + if exception: + raise exception |