From 157b19b5b99d5ab0ea5f62bb8231765916bf90d8 Mon Sep 17 00:00:00 2001 From: Qwerty-133 <74311372+Qwerty-133@users.noreply.github.com> Date: Wed, 15 Sep 2021 21:17:29 +0530 Subject: [PATCH] Don't call `on_command_error` when a check errors. --- bot/exts/core/error_handler.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bot/exts/core/error_handler.py b/bot/exts/core/error_handler.py index fd2123e757..01f620a33f 100644 --- a/bot/exts/core/error_handler.py +++ b/bot/exts/core/error_handler.py @@ -160,14 +160,13 @@ async def send_command_suggestion(self, ctx: commands.Context, command_name: str if not similar_command: return - log_msg = "Cancelling attempt to suggest a command due to failed checks." + base_log_msg = "Cancelling attempt to suggest a command due to failed checks." try: if not await similar_command.can_run(ctx): - log.debug(log_msg) + log.debug(base_log_msg) return - except commands.errors.CommandError as cmd_error: - log.debug(log_msg) - await self.on_command_error(ctx, cmd_error) + except commands.errors.CommandError as error: + log.debug(f"{base_log_msg} A check raised an error: {type(error).__name__} - {str(error)}") return misspelled_content = ctx.message.content