From 83bca5889b38febb740f7f4f66c8017f2684cec6 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Mon, 1 Apr 2024 09:52:56 +0200 Subject: [PATCH] Pass exception value into Sentry Sentry could use the extra information, see for instance [1], we may not need to unwrap this into `error.__cause__` since Python on its own should already expand that. [1]: https://python-discord.sentry.io/issues/5126046667/?project=4506666249945088&query=&referrer=issue-stream&statsPeriod=90d&stream_index=5, --- bot/exts/core/error_handler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/exts/core/error_handler.py b/bot/exts/core/error_handler.py index 2482fb9..0c31011 100644 --- a/bot/exts/core/error_handler.py +++ b/bot/exts/core/error_handler.py @@ -58,7 +58,10 @@ async def on_command_error(self, ctx: Context, error: CommandError) -> None: embed = self._get_error_embed("Command not found", str(error)) else: # If we haven't handled it by this point, it is considered an unexpected/handled error. - log.exception(f"Error executing command invoked by {ctx.message.author}: {ctx.message.content}") + log.exception( + f"Error executing command invoked by {ctx.message.author}: {ctx.message.content}", + exc_info=error, + ) embed = self._get_error_embed( "Unexpected error", "Sorry, an unexpected error occurred. Please let us know!\n\n"