Skip to content

fix(backend): report 413 errors to Sentry at error level#2342

Merged
gregberge merged 1 commit into
mainfrom
fix/sentry-413-error-level
Jul 8, 2026
Merged

fix(backend): report 413 errors to Sentry at error level#2342
gregberge merged 1 commit into
mainfrom
fix/sentry-413-error-level

Conversation

@gregberge

Copy link
Copy Markdown
Member

Problem

The Sentry beforeSend hook downgraded every 4xx error (400–499) to info level. This bucketed 413 "Payload Too Large" errors alongside benign user errors, making them easy to miss — including 413s thrown by express.json() on the /graphql API when a request body exceeds the (default 100kb) limit.

Fix

Add a dedicated branch in beforeSend that keeps 413 at error level and always sends it to Sentry, so we're notified whenever a request body exceeds the configured limit.

This is the single global filter for the backend Sentry client, so it covers /graphql and all other routes.

🤖 Generated with Claude Code

Previously every 4xx error was downgraded to `info` in the Sentry
`beforeSend` hook, so 413 "Payload Too Large" errors (e.g. from
`express.json()` on /graphql) were easy to miss. Keep 413 at `error`
level so we are always notified when a request body exceeds the limit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@argos-ci

argos-ci Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
argos/default (Inspect) ✅ No changes detected - Jul 8, 2026, 3:38 PM
storybook/default (Inspect) ✅ No changes detected - Jul 8, 2026, 3:37 PM
Deployment Status Branch Updated (UTC)
storybook/preview (Open) Ready fix/sentry-413-error-level Jul 8, 2026, 3:37 PM

@gregberge gregberge requested a review from jsfez July 8, 2026 15:42
@gregberge gregberge merged commit 0c9ef48 into main Jul 8, 2026
14 checks passed
@gregberge gregberge deleted the fix/sentry-413-error-level branch July 8, 2026 15:43
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