Skip to content

Conversation

@JPeer264
Copy link
Member

(closes #18449)
(closes JS-1281)

Problem

As of now, the user has no chance to disallow the manipulation of fetch errors, as we overwrite the error. This can cause problems as seen in #18449.

Solution

This adds a new option for the SDK (please be very critical about that new option here, since fetch has no integration this has to be added as a init option). always is the default and acts the same as it is now, so it is acting as feature:

enhanceFetchErrorMessages: 'always' | 'report-only' | false`

To give the user full control of how the errors are done there are 3 settings:

always report-only false
manipulate the error message directly
send only the changed message to Sentry

Special attention to reviewers

When having report-only the generated logs locally differ from the ones in Sentry. I am not quite sure if that would cause any problems. This is the only question which I don't have the answer to yet

@JPeer264 JPeer264 requested review from Lms24 and logaretm December 10, 2025 16:04
@linear
Copy link

linear bot commented Dec 10, 2025

@github-actions
Copy link
Contributor

github-actions bot commented Dec 10, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.89 kB +0.36% +87 B 🔺
@sentry/browser - with treeshaking flags 23.4 kB +0.44% +101 B 🔺
@sentry/browser (incl. Tracing) 41.68 kB +0.31% +128 B 🔺
@sentry/browser (incl. Tracing, Profiling) 46.25 kB +0.24% +109 B 🔺
⛔️ @sentry/browser (incl. Tracing, Replay) (max: 80 kB) 80.1 kB +0.17% +131 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 69.79 kB +0.14% +93 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 84.78 kB +0.17% +138 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 96.99 kB +0.12% +107 B 🔺
@sentry/browser (incl. Feedback) 41.62 kB +0.24% +99 B 🔺
@sentry/browser (incl. sendFeedback) 29.58 kB +0.29% +85 B 🔺
@sentry/browser (incl. FeedbackAsync) 34.59 kB +0.31% +106 B 🔺
@sentry/react 26.62 kB +0.37% +98 B 🔺
@sentry/react (incl. Tracing) 43.85 kB +0.22% +94 B 🔺
@sentry/vue 29.36 kB +0.34% +97 B 🔺
@sentry/vue (incl. Tracing) 43.46 kB +0.24% +104 B 🔺
@sentry/svelte 24.91 kB +0.37% +91 B 🔺
CDN Bundle 27.33 kB +0.34% +91 B 🔺
CDN Bundle (incl. Tracing) 42.33 kB +0.24% +101 B 🔺
CDN Bundle (incl. Tracing, Replay) 78.85 kB +0.13% +102 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 84.31 kB +0.13% +104 B 🔺
CDN Bundle - uncompressed 80.35 kB +0.39% +310 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 125.7 kB +0.25% +310 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 241.73 kB +0.13% +310 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 254.49 kB +0.13% +310 B 🔺
⛔️ @sentry/nextjs (client) (max: 46 kB) 46.07 kB +0.23% +102 B 🔺
⛔️ @sentry/sveltekit (client) (max: 42 kB) 42.03 kB +0.28% +114 B 🔺
@sentry/node-core 51.54 kB +0.09% +42 B 🔺
@sentry/node 159.88 kB +0.04% +54 B 🔺
@sentry/node - without tracing 92.95 kB +0.05% +41 B 🔺
@sentry/aws-serverless 108.48 kB +0.04% +42 B 🔺

View base workflow run

@github-actions
Copy link
Contributor

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 11,916 - 8,630 +38%
GET With Sentry 1,952 16% 1,759 +11%
GET With Sentry (error only) 7,754 65% 6,085 +27%
POST Baseline 1,169 - 1,193 -2%
POST With Sentry 584 50% 595 -2%
POST With Sentry (error only) 1,009 86% 1,067 -5%
MYSQL Baseline 4,095 - 3,241 +26%
MYSQL With Sentry 483 12% 490 -1%
MYSQL With Sentry (error only) 3,326 81% 2,642 +26%

View base workflow run

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.

Appending hostname to fetch error messages breaks is-network-error and p-retry packages

2 participants