@@ -335,9 +335,11 @@ changes:
335
335
* ` err ` {Error} The uncaught exception.
336
336
* ` origin ` {string} Indicates if the exception originates from an unhandled
337
337
rejection or from an synchronous error. Can either be ` 'uncaughtException' ` or
338
- ` 'unhandledRejection' ` . The latter is only used in conjunction with the
339
- [ ` --unhandled-rejections ` ] [ ] flag set to ` strict ` or ` throw ` and
340
- an unhandled rejection.
338
+ ` 'unhandledRejection' ` . The latter is used when in an exception happens in a
339
+ ` Promise ` based async context (or if a ` Promise ` is rejected) and
340
+ [ ` --unhandled-rejections ` ] [ ] flag set to ` strict ` or ` throw ` (which is the
341
+ default) and the rejection is not handled, or when a rejection happens during
342
+ the command line entry point's ES module static loading phase.
341
343
342
344
The ` 'uncaughtException' ` event is emitted when an uncaught JavaScript
343
345
exception bubbles all the way back to the event loop. By default, Node.js
@@ -431,9 +433,11 @@ added:
431
433
* ` err ` {Error} The uncaught exception.
432
434
* ` origin ` {string} Indicates if the exception originates from an unhandled
433
435
rejection or from synchronous errors. Can either be ` 'uncaughtException' ` or
434
- ` 'unhandledRejection' ` . The latter is only used in conjunction with the
435
- [ ` --unhandled-rejections ` ] [ ] flag set to ` strict ` or ` throw ` and
436
- an unhandled rejection.
436
+ ` 'unhandledRejection' ` . The latter is used when in an exception happens in a
437
+ ` Promise ` based async context (or if a ` Promise ` is rejected) and
438
+ [ ` --unhandled-rejections ` ] [ ] flag set to ` strict ` or ` throw ` (which is the
439
+ default) and the rejection is not handled, or when a rejection happens during
440
+ the command line entry point's ES module static loading phase.
437
441
438
442
The ` 'uncaughtExceptionMonitor' ` event is emitted before an
439
443
` 'uncaughtException' ` event is emitted or a hook installed via
0 commit comments