diff options
author | Mathias Buus <mathiasbuus@gmail.com> | 2018-03-14 05:14:08 +0300 |
---|---|---|
committer | Michael Dawson <mdawson@devrus.com> | 2018-03-20 22:48:14 +0300 |
commit | c1695d8bad09fc61922ec91101736debb2d165db (patch) | |
tree | c3214883da34cd76fc358535df0365df5f37828a /src/node_api.h | |
parent | 1203b1372592a5067888987080f30b6b9047d150 (diff) |
n-api: add napi_fatal_exception
Add function to trigger and uncaught exception.
Useful if an async callback throws an exception with
no way to recover.
PR-URL: https://github.com/nodejs/node/pull/19337
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'src/node_api.h')
-rw-r--r-- | src/node_api.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_api.h b/src/node_api.h index 791a8f8725d..aaf002b7584 100644 --- a/src/node_api.h +++ b/src/node_api.h @@ -103,6 +103,8 @@ NAPI_EXTERN napi_status napi_get_last_error_info(napi_env env, const napi_extended_error_info** result); +NAPI_EXTERN napi_status napi_fatal_exception(napi_env env, napi_value err); + NAPI_EXTERN NAPI_NO_RETURN void napi_fatal_error(const char* location, size_t location_len, const char* message, |