aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Rohan <[email protected]>2020-12-02 21:58:09 +0530
committerGravatar Rohan <[email protected]>2020-12-02 21:58:09 +0530
commit4d2f89991432639431968d352bde2cd747b9432c (patch)
treed7e1fede875ef75e2030956fa7aedf23643a30f5
parentFix leaderboard glitch caused by duplicate names (diff)
Modify error handler check for locally handled errors.
Error handler now checks if the error has the attribute "handled" for locally handled errors.
-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..b502dd4e 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 hasattr(error, 'handled'):
+ logging.debug(f"Command {ctx.command} had its error already handled locally; ignoring.")
return
error = getattr(error, 'original', error)