Skip to content

[FastAPI, Starlette] Clarify failed_request_status_codes does not affect non-HTTPException exceptions #11488

@szokeasaurusrex

Description

@szokeasaurusrex

SDK

Python SDK

Description

The Starlette and FastAPI integrations' failed_request_status_codes option only affects HTTPException exceptions and other similar exception types with a status_code attribute. Other unhandled exceptions (e.g. ZeroDivisionError) that are raised by the request handler are sent to Sentry in the SentryAsgiMiddleware, which the failed_request_status_codes option does not affect.

Suggested Solution

Add something like the following:

The failed_request_status_codes option only controls whether HTTPException exceptions should be reported to Sentry. Other unhandled exceptions, which do not have a status_code attribute, are always reported to Sentry.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions