An exception may occur when a Node-API is called. For critical service processes, you need to add the processing logic to check the return value and determine whether an exception occurs. Sample code:
napi_status status = napi_create_object(env, &object);
if (status != napi_ok) {
napi_throw_error(env, nullptr, "Error");
return;
}