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

Function CatchErrorMessage

test/error.cc:187–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187Value CatchErrorMessage(const CallbackInfo& info) {
188 Function thrower = info[0].As<Function>();
189 try {
190 thrower({});
191 } catch (const Error& e) {
192 std::string message = e.Message();
193 return String::New(info.Env(), message);
194 }
195 return info.Env().Null();
196}
197
198void CatchAndRethrowError(const CallbackInfo& info) {
199 Function thrower = info[0].As<Function>();

Callers

nothing calls this directly

Calls 1

EnvMethod · 0.80

Tested by

no test coverage detected