From c457fae7f0dc61419a33e0d4385c91062878db7b Mon Sep 17 00:00:00 2001 From: JPeer264 Date: Fri, 19 Dec 2025 16:49:15 +0100 Subject: [PATCH] feat: Add new option for enhanceFetchErrorMessages --- .../javascript/common/configuration/options.mdx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/platforms/javascript/common/configuration/options.mdx b/docs/platforms/javascript/common/configuration/options.mdx index 0097015545f853..f5295488fb5189 100644 --- a/docs/platforms/javascript/common/configuration/options.mdx +++ b/docs/platforms/javascript/common/configuration/options.mdx @@ -341,6 +341,18 @@ By the time `beforeSend` is executed, all scope data has already been applied to + + +Controls whether and how to enhance fetch error messages by appending the request hostname. Generic fetch errors like "Failed to fetch" will be enhanced to include the hostname (e.g., "Failed to fetch (example.com)") to provide better context in Sentry. + +Available options: + +- `'always'` (default): Modifies the actual error message directly. This may break third-party packages that rely on exact message matching (e.g., `is-network-error`, `p-retry`). +- `'report-only'`: Only enhances the message when sending to Sentry. The original error message remains unchanged, preserving compatibility with third-party packages that check error messages. +- `false`: Disables hostname enhancement completely. + + +