Skip to content

Commit 58994c0

Browse files
authored
docs(js): Document errorHandleroption for nextjs (#14129)
1 parent 86c8f70 commit 58994c0

File tree

1 file changed

+18
-0
lines changed
  • docs/platforms/javascript/guides/nextjs/configuration/build

1 file changed

+18
-0
lines changed

docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,24 @@ Prints additional debug information about the SDK and uploading source maps when
7474

7575
</SdkOption>
7676

77+
<SdkOption name="errorHandler" type="(error: Error) => void">
78+
79+
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.
80+
You can optionally re-throw the error to fail the build process.
81+
82+
```javascript
83+
withSentryConfig(nextConfig, {
84+
// ... other options
85+
errorHandler: (error) => {
86+
console.warn('Sentry build error occurred:', error);
87+
// Optionally, you can still fail the build by re-throwing the error
88+
// throw error;
89+
}
90+
});
91+
```
92+
93+
</SdkOption>
94+
7795
## Source Maps Options
7896

7997
<SdkOption name="sourcemaps.disable" type="boolean">

0 commit comments

Comments
 (0)