MCPcopy Create free account
hub / github.com/nodejs/node-addon-api / CatchAndRethrowError

Function CatchAndRethrowError

test/error.cc:198–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198void CatchAndRethrowError(const CallbackInfo& info) {
199 Function thrower = info[0].As<Function>();
200 try {
201 thrower({});
202 } catch (Error& e) {
203 e.Set("caught", Boolean::New(info.Env(), true));
204 throw;
205 }
206}
207
208void ThrowErrorThatEscapesScope(const CallbackInfo& info) {
209 HandleScope scope(info.Env());

Callers

nothing calls this directly

Calls 3

SetMethod · 0.80
EnvMethod · 0.80

Tested by

no test coverage detected