Skip to content

Commit

Permalink
Make error handler better for unknown exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ToothyDev committed Aug 22, 2024
1 parent 84a879d commit 1723930
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cogs/events/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ async def on_application_command_error(self, ctx: discord.ApplicationContext,
return await ctx.respond("The service this command uses had an error. Try again later.", ephemeral=True)

await ctx.respond("An unknown error occured! This will be logged and fixed!", ephemeral=True)
print(f"{ctx.author.global_name} used /{ctx.command} which caused {err}\nError class: {err.__class__.__name__}")
raise Exception(
f"{ctx.author.global_name} used /{ctx.command} which caused {err} - Error class: {err.__class__.__name__}") from err


def setup(bot):
Expand Down

0 comments on commit 1723930

Please sign in to comment.