Skip to content

Commit

Permalink
doc: Napi::Error is caught
Browse files Browse the repository at this point in the history
PR-URL: #1241
Reviewed-By: Michael Dawson <midawson@redhat.com
  • Loading branch information
NickNaso authored and mhdawson committed Dec 2, 2022
1 parent 10ad762 commit de5a502
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/error_handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The following sections explain the approach for each case:
<a name="exceptions"></a>

In most cases when an error occurs, the addon should do whatever cleanup is possible
and then return to JavaScript so that the error can be propagated. In less frequent
and then return to JavaScript so that the error can be propagated. In less frequent
cases the addon may be able to recover from the error, clear the error and then
continue.

Expand All @@ -48,8 +48,8 @@ method.
If a C++ exception of type `Napi::Error` escapes from a Node-API C++ callback, then
the Node-API wrapper automatically converts and throws it as a JavaScript exception.

On return from a native method, node-addon-api will automatically convert a pending C++
exception to a JavaScript exception.
On return from a native method, node-addon-api will automatically convert a pending
`Napi::Error` C++ exception to a JavaScript exception.

When C++ exceptions are enabled try/catch can be used to catch exceptions thrown
from calls to JavaScript and then they can either be handled or rethrown before
Expand Down

0 comments on commit de5a502

Please sign in to comment.