[v10.x] backport #26599 (process: add --unhandled-rejections flag) by BridgeAR · Pull Request #29036 · nodejs/node

@BridgeAR

This adds a flag to define the default behavior for unhandled
rejections. Three modes exist: `none`, `warn` and `strict`. The first
is going to silence all unhandled rejection warnings. The second
behaves identical to the current default with the excetion that no
deprecation warning will be printed and the last is going to throw
an error for each unhandled rejection, just as regular exceptions do.
It is possible to intercept those with the `uncaughtException` hook
as with all other exceptions as well.

This PR has no influence on the existing `unhandledRejection` hook.
If that is used, it will continue to function as before.

PR-URL: nodejs#26599
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>

@nodejs-github-bot added c++

Issues and PRs that require attention from people who are familiar with C++.

lib / src

Issues and PRs related to general changes in the lib or src directory.

v10.x labels

Aug 7, 2019

@addaleax addaleax added the semver-minor

PRs that contain new features and should be released in the next minor version.

label

Sep 24, 2019

addaleax

@BridgeAR

This adds a missing return value for the worker specific fatal
exception handler.

BethGriggs

BethGriggs pushed a commit that referenced this pull request

Oct 15, 2019
This adds a missing return value for the worker specific fatal
exception handler.

PR-URL: #29036
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>