Skip to content

422 is not reported despite setting failed_request_status_codes #3296

@sentrivana

Description

@sentrivana

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2.9.0

Steps to Reproduce

From Discord:

Using Sentry with FastAPI, I'm initializing Sentry as follows:

failed_request_status_codes = [range(400, 600)]
sentry_sdk.init(
    integrations=[
        StarletteIntegration(failed_request_status_codes=failed_request_status_codes),
        FastApiIntegration(failed_request_status_codes=failed_request_status_codes),
    ],
    before_send=filter_transactions,
)

HTTPException raised directly or unexpected 500 errors are well reported to Sentry. However, 422 errors, where the request doesn't match the expected type, are not being sent to Sentry. How can I resolve this?

Expected Result

422s should be reported.

Actual Result

422s are not reported.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions