diff options
author | Mathias Buus <mathiasbuus@gmail.com> | 2018-03-14 03:14:08 +0100 |
---|---|---|
committer | Michael Dawson <mdawson@devrus.com> | 2018-03-20 15:48:14 -0400 |
commit | c1695d8bad09fc61922ec91101736debb2d165db (patch) | |
tree | c3214883da34cd76fc358535df0365df5f37828a /doc | |
parent | 1203b1372592a5067888987080f30b6b9047d150 (diff) | |
download | android-node-v8-c1695d8bad09fc61922ec91101736debb2d165db.tar.gz android-node-v8-c1695d8bad09fc61922ec91101736debb2d165db.tar.bz2 android-node-v8-c1695d8bad09fc61922ec91101736debb2d165db.zip |
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 'doc')
-rw-r--r-- | doc/api/n-api.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 7178d3a4a8..a625741603 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -541,6 +541,20 @@ This API returns true if an exception is pending. This API can be called even if there is a pending JavaScript exception. +#### napi_fatal_exception +<!-- YAML +added: REPLACEME +--> +```C +napi_status napi_fatal_exception(napi_env env, napi_value err); +``` + +- `[in] env`: The environment that the API is invoked under. +- `[in] err`: The error you want to pass to `uncaughtException`. + +Trigger an `uncaughtException` in JavaScript. Useful if an async +callback throws an exception with no way to recover. + ### Fatal Errors In the event of an unrecoverable error in a native module, a fatal error can be |