Skip to content

Commit af57df0

Browse files
mydeavivianyentran
andauthored
fix: Fix options for Node UnhandledRejection integration (#11245)
--------- Co-authored-by: vivianyentran <[email protected]>
1 parent 480d5b3 commit af57df0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

docs/platforms/javascript/common/configuration/integrations/unhandledrejection.mdx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,15 @@ The `onUnhandledRejectionIntegration` registers handlers to capture global unhan
3838

3939
## Options
4040

41-
### `exitEvenIfOtherHandlersAreRegistered`
41+
### `mode`
4242

43-
_Type: `boolean`_
43+
_Type: `'none' | 'warn' | 'strict'`_
4444

45-
If set to false, the SDK will _not_ exit if we detect that another uncaught exception handler is registered.
45+
This option defines what to do after capturing an unhandled rejection and
46+
mimics the behavior of [node's](https://nodejs.org/api/cli.html#--unhandled-rejectionsmode) `--unhandled-rejection` flag:
4647

47-
### `onFatalError`
48+
- `strict`: Raise the unhandled rejection as an uncaught exception. If the exception is handled, unhandledRejection is emitted.
49+
- `warn`: Always trigger a warning, no matter if the unhandledRejection hook is set or not but do not print the deprecation warning.
50+
- `none`: Silence all warnings.
4851

49-
_Type: `(firstError: Error, secondError: Error | undefined) => void`_
50-
51-
This method is called when an uncaught error would cause the process to exit. `secondError` will be set if the handler was called multiple times. This can happen either because `onFatalError` itself threw, or because an independent error happened somewhere else while `onFatalError` was running.
52+
Defaults to `none`.

0 commit comments

Comments
 (0)