diff options
author | 2022-07-09 23:32:41 +0100 | |
---|---|---|
committer | 2022-07-09 23:32:41 +0100 | |
commit | de8b505bd17b9e38c5b49a077db1386b52df4990 (patch) | |
tree | 7c9ec4b4830f6d78bbb7adc4067a5073af10b34e | |
parent | Remove 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.py | 4 |
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}" ) |