napi_fatal_exception


napi_status napi_fatal_exception(napi_env env, napi_value err); 
  • [in] env:调用该 API 时所处的环境。
  • [in] err:传递给 'uncaughtException' 的错误。

在 JavaScript 中触发 'uncaughtException'。如果异步回调抛出异常且无法恢复,这很有用。

【Trigger an 'uncaughtException' in JavaScript. Useful if an async callback throws an exception with no way to recover.】