Skip to content

fix(sveltekit): Avoid capturing redirect() calls as errors in Cloudflare - #16853

Merged
Lms24 merged 1 commit into
developfrom
lms/fix-sveltekit-cf-wrapReqHandler-dont-capture-errors
Jul 9, 2025
Merged

fix(sveltekit): Avoid capturing redirect() calls as errors in Cloudflare#16853
Lms24 merged 1 commit into
developfrom
lms/fix-sveltekit-cf-wrapReqHandler-dont-capture-errors

Conversation

@Lms24

@Lms24 Lms24 commented Jul 9, 2025

Copy link
Copy Markdown
Member

This PR builds on top of #16852 to avoid capturing errors too early and too generally via the initCloudflareSentryHandle request handler. Internally, this handler used a wrapper from @sentry/cloudflare to capture errors but prior to #16852 it captured everything that was thrown. This included thrown redirect() objects from SvelteKit which serve as control flow mechanisms but should not be captured as errors.

This PR opts out of capturing errors in the Cloudflare wrapper. Instead, we rely on our already existing error capturing mechanisms in SvelteKit, which already ignore redirect() and a few other error classes.

closes #16847

@Lms24
Lms24 changed the base branch from develop to lms/feat-cloudflare-wrapRequestHandler-captureErrors July 9, 2025 08:40
@Lms24 Lms24 self-assigned this Jul 9, 2025
@Lms24
Lms24 requested review from a team, andreiborza and s1gr1d and removed request for a team July 9, 2025 08:43
@Lms24 Lms24 changed the title fix(sveltekit): Avoid capturing redirect() calls as errors in CloudFlare fix(sveltekit): Avoid capturing redirect() calls as errors in Cloudflare Jul 9, 2025
@Lms24 Lms24 linked an issue Jul 9, 2025 that may be closed by this pull request
3 tasks
Base automatically changed from lms/feat-cloudflare-wrapRequestHandler-captureErrors to develop July 9, 2025 13:35
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.

'Redirect' captured as exception with keys: location, status

3 participants