From d69c5e4c11efbaa7e74dc7468762045de9c253e6 Mon Sep 17 00:00:00 2001 From: Sabi <120003982+cyanogus@users.noreply.github.com> Date: Fri, 16 Jun 2023 12:35:54 +0530 Subject: [PATCH 1/2] Add command error details output for uncaught errors This should make development easier, better debugging and testing for commands, and general debugging purposes. (Referenced from #295) --- main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.py b/main.py index 0337610d..f6b99960 100644 --- a/main.py +++ b/main.py @@ -170,6 +170,8 @@ async def on_application_command_error(ctx: ApplicationContext, error: discord.D elif isinstance(error, commands.BadBoolArgument): await ctx.respond(":x: Invalid true/false argument.", delete_after=8) print(f"[{current_time}] Ignoring exception at {colors.cyan}BadBoolArgument{colors.end}.") + else: + await ctx.respond(f"An uncaught error occured while running the command.\n```\n{type(error)._name__}: {error}\n```") #Commands @client.slash_command( From 8a6c4b0cbb15de36a44a522f839248d3e99ca286 Mon Sep 17 00:00:00 2001 From: snipe_blaze <72265661+notsniped@users.noreply.github.com> Date: Fri, 16 Jun 2023 23:48:50 +0530 Subject: [PATCH 2/2] Remove error type display The `error` argument already displays the entire exception details in the command. --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index f6b99960..54cefd2b 100644 --- a/main.py +++ b/main.py @@ -171,7 +171,7 @@ async def on_application_command_error(ctx: ApplicationContext, error: discord.D await ctx.respond(":x: Invalid true/false argument.", delete_after=8) print(f"[{current_time}] Ignoring exception at {colors.cyan}BadBoolArgument{colors.end}.") else: - await ctx.respond(f"An uncaught error occured while running the command.\n```\n{type(error)._name__}: {error}\n```") + await ctx.respond(f"An uncaught error occured while running the command.\n```\n{error}\n```") #Commands @client.slash_command(