From 9dcc9b6a6b3b8ab40be91b2fdc6fdf514e48dcc3 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 11 Mar 2019 20:46:43 +0100 Subject: process: add --unhandled-rejections flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/nodejs/node/pull/26599 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Matteo Collina Reviewed-By: Matheus Marchini Reviewed-By: Michael Dawson Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Sakthipriyan Vairamani --- src/node_errors.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/node_errors.h') diff --git a/src/node_errors.h b/src/node_errors.h index b04a347f1e..c27f4b36fa 100644 --- a/src/node_errors.h +++ b/src/node_errors.h @@ -39,6 +39,11 @@ void FatalException(v8::Isolate* isolate, Local error, Local message); +void FatalException(v8::Isolate* isolate, + Local error, + Local message, + bool from_promise); + // Helpers to construct errors similar to the ones provided by // lib/internal/errors.js. // Example: with `V(ERR_INVALID_ARG_TYPE, TypeError)`, there will be -- cgit v1.2.3