aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/ext/tasks/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/discord/ext/tasks/__init__.py b/discord/ext/tasks/__init__.py
index b7b15f1d..649fbd48 100644
--- a/discord/ext/tasks/__init__.py
+++ b/discord/ext/tasks/__init__.py
@@ -3,11 +3,14 @@ import aiohttp
import websockets
import discord
import inspect
+import logging
from discord.backoff import ExponentialBackoff
MAX_ASYNCIO_SECONDS = 3456000
+log = logging.getLogger(__name__)
+
class Loop:
"""A background task helper that abstracts the loop and reconnection logic for you.
@@ -86,6 +89,9 @@ class Loop:
except asyncio.CancelledError:
self._is_being_cancelled = True
raise
+ except Exception as e:
+ log.exception('Internal background task failed.')
+ raise
finally:
await self._call_loop_function('after_loop')
self._is_being_cancelled = False