From aa4a6198891cab24a060b2fb9555f6c24038edbd Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Tue, 24 Jun 2025 15:07:52 +0200 Subject: [PATCH 1/2] document errorHandler --- .../nextjs/configuration/build/index.mdx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx index d0826b91ef670..0f221fb166f46 100644 --- a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx @@ -74,6 +74,25 @@ Prints additional debug information about the SDK and uploading source maps when + + +A callback function that will be invoked when errors occur during the Sentry build process. This is particularly useful for preventing CI/CD pipeline failures when there are connectivity issues. + +You can use this option to handle errors gracefully: + +```javascript +withSentryConfig(nextConfig, { + // ... other options + errorHandler: (error) => { + console.warn('Sentry build error occurred:', error); + // Optionally, you can still fail the build by re-throwing the error + // throw error; + } +}); +``` + + + ## Source Maps Options From 62d6fff895b272b768dd5c2e93ee5c75f075256e Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Tue, 24 Jun 2025 16:05:19 +0200 Subject: [PATCH 2/2] boop --- .../javascript/guides/nextjs/configuration/build/index.mdx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx index 0f221fb166f46..ab24d97478327 100644 --- a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx @@ -76,9 +76,8 @@ Prints additional debug information about the SDK and uploading source maps when -A callback function that will be invoked when errors occur during the Sentry build process. This is particularly useful for preventing CI/CD pipeline failures when there are connectivity issues. - -You can use this option to handle errors gracefully: +A callback function that will be invoked when errors occur during the Sentry build process. This is particularly useful for gracefully handling CI/CD pipeline failures when there are connectivity issues. +You can optionally re-throw the error to fail the build process. ```javascript withSentryConfig(nextConfig, {