mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
Fallback to asyncio's default exception handler when possible (#5813)
Co-authored-by: Jakub Kuczys <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
parent
c390b89bd2
commit
d0f22a7773
@ -450,14 +450,7 @@ def global_exception_handler(red, loop, context):
|
|||||||
# These will get handled later when it *also* kills loop.run_forever
|
# These will get handled later when it *also* kills loop.run_forever
|
||||||
if exc is not None and isinstance(exc, (KeyboardInterrupt, SystemExit)):
|
if exc is not None and isinstance(exc, (KeyboardInterrupt, SystemExit)):
|
||||||
return
|
return
|
||||||
# Maybe in the future we should handle some of the other things
|
loop.default_exception_handler(context)
|
||||||
# that the default exception handler handles, but this should work fine for now.
|
|
||||||
log.critical(
|
|
||||||
"Caught unhandled exception in %s:\n%s",
|
|
||||||
context.get("future", "event loop"),
|
|
||||||
context["message"],
|
|
||||||
exc_info=exc,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def red_exception_handler(red, red_task: asyncio.Future):
|
def red_exception_handler(red, red_task: asyncio.Future):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user