aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-07-09 23:32:41 +0100
committerGravatar Chris Lovering <[email protected]>2022-07-09 23:32:41 +0100
commitde8b505bd17b9e38c5b49a077db1386b52df4990 (patch)
tree7c9ec4b4830f6d78bbb7adc4067a5073af10b34e
parentRemove superfluous guards (diff)
Simplify the error handler instance check
This also fixes the debug output to ensure the command name is always included Co-authored-by: HassanAbouelela <[email protected]>
-rw-r--r--metricity/exts/error_handler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/metricity/exts/error_handler.py b/metricity/exts/error_handler.py
index 3d42d05..0f35de2 100644
--- a/metricity/exts/error_handler.py
+++ b/metricity/exts/error_handler.py
@@ -30,9 +30,9 @@ class ErrorHandler(commands.Cog):
@commands.Cog.listener()
async def on_command_error(self, ctx: commands.Context, e: commands.errors.CommandError) -> None:
"""Provide generic command error handling."""
- if any(isinstance(e, suppressed_error) for suppressed_error in SUPPRESSED_ERRORS):
+ if isinstance(e, SUPPRESSED_ERRORS):
log.debug(
- f"Command {ctx.command} invoked by {ctx.message.author} with error "
+ f"Command {ctx.invoked_with} invoked by {ctx.message.author} with error "
f"{e.__class__.__name__}: {e}"
)