Skip to content

fix(sentry): Filter 404s from error capture - #50

Open
sentry[bot] wants to merge 1 commit into
devfrom
seer/fix/sentry-404-filter
Open

fix(sentry): Filter 404s from error capture#50
sentry[bot] wants to merge 1 commit into
devfrom
seer/fix/sentry-404-filter

Conversation

@sentry

@sentry sentry Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

This PR modifies the starlette_http_error_handler in core/nurse_scheduling/server/app.py to explicitly exclude 404 Not Found errors from being captured by Sentry.

Previously, all 4xx HTTP exceptions were captured, leading to Sentry being spammed with "Invalid API request" issues triggered by external bot traffic scanning for non-existent paths. These 404s are noise and not indicative of actual application errors.

The change adds and exc.status_code != 404 to the condition that triggers Sentry capture, ensuring that only relevant 4xx client errors (e.g., 400, 401, 403, 413, 422) are reported.

Fixes NURSE-SCHEDULING-59

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.

0 participants