Checks that the return status of C API is true, returns error in JS exception otherwise.
| 36 | |
| 37 | // Checks that the return status of C API is true, returns error in JS exception otherwise. |
| 38 | inline bool CheckStatus(Napi::Env& env, bool status) { |
| 39 | if (!status) { |
| 40 | const char* errorMessage = GetErrorString(); |
| 41 | CheckNotNull(env, errorMessage, "Internal error - error message expected, but missing"); |
| 42 | Napi::Error::New(env, errorMessage).ThrowAsJavaScriptException(); |
| 43 | } |
| 44 | |
| 45 | return status; |
| 46 | } |
| 47 | |
| 48 | // Matrix types in N-API |
| 49 | enum ENApiType { |
no test coverage detected