From eb4af489516f29cba342e625deca5a30ac23dc29 Mon Sep 17 00:00:00 2001 From: Katelyn Gigante Date: Sat, 29 Oct 2022 01:18:44 +1100 Subject: [PATCH] feat: Include author context in Sentry error reports --- naff/ext/sentry.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/naff/ext/sentry.py b/naff/ext/sentry.py index f790f8e75..4ef3b39be 100644 --- a/naff/ext/sentry.py +++ b/naff/ext/sentry.py @@ -68,6 +68,8 @@ async def on_error(self, event: Error) -> None: "message": event.ctx.message, }, ) + if event.ctx.author: + scope.set_user({"id": event.ctx.author.id, "username": event.ctx.author.tag}) sentry_sdk.capture_exception(event.error)