Skip to content

Fix missing Sentry stacktraces on error events#122

Merged
timothedelion merged 1 commit intomainfrom
tdelion/APPAI-515/sentry-stacktrace
Mar 20, 2026
Merged

Fix missing Sentry stacktraces on error events#122
timothedelion merged 1 commit intomainfrom
tdelion/APPAI-515/sentry-stacktrace

Conversation

@timothedelion
Copy link
Copy Markdown
Member

Summary

Sentry error events triggered by logger.error() inside exception handlers were missing stacktraces because logger.error doesn't include exc_info. This switches to logger.exception() where an active exception context exists.

Issue: APPAI-515

Changes

In the HTTP client's 401 token-refresh failure path, replaced logger.error with logger.exception so the active HTTPStatusError exception context is forwarded to Sentry, producing a proper stacktrace in error events.

When a 401 token refresh fails, the error was logged with
logger.error which produces Sentry events without stacktraces.
Switching to logger.exception includes the active exception
context so Sentry displays a proper stacktrace.

Issue: APPAI-515
@linear
Copy link
Copy Markdown

linear bot commented Mar 20, 2026

@timothedelion timothedelion self-assigned this Mar 20, 2026
@timothedelion timothedelion marked this pull request as ready for review March 20, 2026 13:41
@timothedelion timothedelion merged commit 762bfde into main Mar 20, 2026
5 checks passed
@timothedelion timothedelion requested a review from KNedelec March 20, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant