Skip to content

Fix Sentry capturing notFound as errors - #1191

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/sentry-not-found-errors
Open

Fix Sentry capturing notFound as errors#1191
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/sentry-not-found-errors

Conversation

@sentry

@sentry sentry Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

This PR addresses an issue where Sentry was reporting false positive errors due to TanStack Start's notFound() control flow.

TanStack Start uses throw { isNotFound: true } as a mechanism to signal a 404 state, which is not a true error but a control flow. Sentry's server-side middleware was indiscriminately capturing these thrown objects as exceptions.

The fix involves modifying src/instrument.server.mjs to wrap the beforeSend function. The wrapper now checks if the thrown exception (hint.originalException) has an isNotFound property set to true. If so, it returns null, preventing Sentry from reporting it as an error. Otherwise, it delegates to the original redactByokRequestHeaders function.

Fixes TANSTACK-COM-4QS

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com 1a67335 Commit Preview URL

Branch Preview URL
Aug 29 2026, 11:03 PM

@tannerlinsley tannerlinsley added the source-audit Tracked by the automated source audit label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

source-audit Tracked by the automated source audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant