diff --git a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx index d0826b91ef670..ab24d97478327 100644 --- a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx @@ -74,6 +74,24 @@ 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 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, { + // ... 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