Skip to content

Commit

Permalink
Pass exception value into Sentry
Browse files Browse the repository at this point in the history
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,
  • Loading branch information
jchristgit committed Apr 1, 2024
1 parent 4b1a847 commit 83bca58
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bot/exts/core/error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 83bca58

Please # to comment.