From 352adcb437443201c8a7e47ec321e5d4bdae6d22 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Sun, 24 May 2020 00:24:59 +0200 Subject: [PATCH] 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: https://github.com/nodejs/node/issues/32907 Signed-off-by: Ruben Bridgewater PR-URL: https://github.com/nodejs/node/pull/33530 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell --- doc/api/process.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/api/process.md b/doc/api/process.md index 2851f9a29b731d..870e0904ffefd6 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -233,8 +233,9 @@ changes: * `err` {Error} The uncaught exception. * `origin` {string} Indicates if the exception originates from an unhandled - rejection or from synchronous errors. Can either be `'uncaughtException'` or - `'unhandledRejection'`. + rejection or from an synchronous error. Can either be `'uncaughtException'` or + `'unhandledRejection'`. The latter is only used in conjunction with the + [`--unhandled-rejections`][] flag set to `strict` and an unhandled rejection. The `'uncaughtException'` event is emitted when an uncaught JavaScript exception bubbles all the way back to the event loop. By default, Node.js @@ -2582,6 +2583,7 @@ cases: [`'exit'`]: #process_event_exit [`'message'`]: child_process.html#child_process_event_message [`'uncaughtException'`]: #process_event_uncaughtexception +[`--unhandled-rejections`]: cli.html#cli_unhandled_rejections_mode [`Buffer`]: buffer.html [`ChildProcess.disconnect()`]: child_process.html#child_process_subprocess_disconnect [`ChildProcess.send()`]: child_process.html#child_process_subprocess_send_message_sendhandle_options_callback