aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/error_handler.py
diff options
context:
space:
mode:
authorGravatar Sebastiaan Zeeff <[email protected]>2020-12-13 10:57:43 +0100
committerGravatar Sebastiaan Zeeff <[email protected]>2020-12-13 10:57:43 +0100
commitdca6ec330694f8ff09a21a0f70dfc2b06feea674 (patch)
treed96964e01ff4310997671d69ef8ce7932902238d /bot/exts/evergreen/error_handler.py
parentUpdate docstrings and fix grammar in comments (diff)
parentAdd callback to log errors in AoC background tasks (diff)
Merge branch 'master' into sebastiaan/advent-of-code/refactor-background-tasks
# Conflicts: # bot/exts/christmas/advent_of_code/_cog.py # bot/exts/christmas/advent_of_code/_helpers.py
Diffstat (limited to 'bot/exts/evergreen/error_handler.py')
-rw-r--r--bot/exts/evergreen/error_handler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/exts/evergreen/error_handler.py b/bot/exts/evergreen/error_handler.py
index 6e518435..99af1519 100644
--- a/bot/exts/evergreen/error_handler.py
+++ b/bot/exts/evergreen/error_handler.py
@@ -42,8 +42,8 @@ class CommandErrorHandler(commands.Cog):
@commands.Cog.listener()
async def on_command_error(self, ctx: commands.Context, error: commands.CommandError) -> None:
"""Activates when a command opens an error."""
- if hasattr(ctx.command, 'on_error'):
- logging.debug("A command error occured but the command had it's own error handler.")
+ if getattr(error, 'handled', False):
+ logging.debug(f"Command {ctx.command} had its error already handled locally; ignoring.")
return
error = getattr(error, 'original', error)