Skip to content

Commit f762686

Browse files
committed
doc: outline when origin is set to unhandledRejection
The `uncaughtException` listener's origin argument was ambiguous about unhandled rejections. This should clarify when origin is set to `'unhandledRejection'`. Fixes: #32907 Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> PR-URL: #33530 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent cd9bc20 commit f762686

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

doc/api/process.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,9 @@ changes:
233233

234234
* `err` {Error} The uncaught exception.
235235
* `origin` {string} Indicates if the exception originates from an unhandled
236-
rejection or from synchronous errors. Can either be `'uncaughtException'` or
237-
`'unhandledRejection'`.
236+
rejection or from an synchronous error. Can either be `'uncaughtException'` or
237+
`'unhandledRejection'`. The latter is only used in conjunction with the
238+
[`--unhandled-rejections`][] flag set to `strict` and an unhandled rejection.
238239

239240
The `'uncaughtException'` event is emitted when an uncaught JavaScript
240241
exception bubbles all the way back to the event loop. By default, Node.js
@@ -2604,6 +2605,7 @@ cases:
26042605
[`'exit'`]: #process_event_exit
26052606
[`'message'`]: child_process.html#child_process_event_message
26062607
[`'uncaughtException'`]: #process_event_uncaughtexception
2608+
[`--unhandled-rejections`]: cli.html#cli_unhandled_rejections_mode
26072609
[`Buffer`]: buffer.html
26082610
[`ChildProcess.disconnect()`]: child_process.html#child_process_subprocess_disconnect
26092611
[`ChildProcess.send()`]: child_process.html#child_process_subprocess_send_message_sendhandle_options_callback

0 commit comments

Comments
 (0)