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

Function CatchError

test/error.cc:177–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175#endif // NAPI_VERSION > 8
176
177Value CatchError(const CallbackInfo& info) {
178 Function thrower = info[0].As<Function>();
179 try {
180 thrower({});
181 } catch (const Error& e) {
182 return e.Value();
183 }
184 return info.Env().Null();
185}
186
187Value CatchErrorMessage(const CallbackInfo& info) {
188 Function thrower = info[0].As<Function>();

Callers

nothing calls this directly

Calls 2

ValueMethod · 0.80
EnvMethod · 0.80

Tested by

no test coverage detected