napi_fatal_exception


napi_status napi_fatal_exception(napi_env env, napi_value err); 
  • [in] env:调用 API 的环境。

    ¥[in] env: The environment that the API is invoked under.

  • [in] err:传递给 'uncaughtException' 的错误。

    ¥[in] err: The error that is passed to 'uncaughtException'.

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

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