From 1a67335cfe8604470e122341ba6a6b898320af31 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Sat, 29 Aug 2026 23:01:09 +0000 Subject: [PATCH] Fix Sentry capturing notFound as errors --- src/instrument.server.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/instrument.server.mjs b/src/instrument.server.mjs index 291e7d1e3..ce545090a 100644 --- a/src/instrument.server.mjs +++ b/src/instrument.server.mjs @@ -9,5 +9,8 @@ Sentry.init({ tracesSampleRate: 1.0, // Capture 100% of the transactions // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled tracePropagationTargets: ['localhost', /^https:\/\/tanstack\.com\//], - beforeSend: redactByokRequestHeaders, + beforeSend: (event, hint) => { + if (hint.originalException?.isNotFound) return null + return redactByokRequestHeaders(event, hint) + }, })