-
-
Notifications
You must be signed in to change notification settings - Fork 493
Closed
Description
The documentation states "On return from a native method, node-addon-api will automatically convert a pending C++ exception to a JavaScript exception." but in InstanceMethodCallbackWrapper when I call a C++ API that throws std::exception, std::terminate is called because no exception handler is installed. If I wrap my call in something like
try {
my_api();
} catch (const std::exception &e) {
Napi::Error::New(info.Env(), e.what()).ThrowAsJavaScriptException();
}
Then the exceptions are passed up to javascript, but based on my reading of the documentation I shouldn't need to do this.
Metadata
Metadata
Assignees
Labels
No labels