Skip to content

Capture Sentry errors handled by integer status - #448

Merged
lesnik512 merged 1 commit into
mainfrom
fix/sentry-status-handlers
Nov 6, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
fix/sentry-status-handlers

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Closes #439.

Summary

  • Apply the existing Sentry reporting wrapper to Starlette's integer-status exception handlers.
  • Verify that default, sync, and async FastAPI handlers each report exactly one handled 503 event with request details. Disable SDK deduplication in the test so duplicate captures would fail it.
  • Verify that a custom 404 handler and an explicit 503 response produce no exception events.

Verification

  • Both custom handler cases captured zero events before the fix and one afterward.
  • just test-ci passed with 665 tests and 100% line coverage. Ruff and ty passed.
  • A focused smoke test passed on FastAPI 0.112.2 and Sentry SDK 2.70.0.

@lesnik512
lesnik512 merged commit ade10e4 into main Nov 6, 2026
35 checks passed
@lesnik512
lesnik512 deleted the fix/sentry-status-handlers branch November 6, 2026 10:23
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.

[P2] Capture server errors handled by integer-status exception handlers

1 participant