MCPcopy Create free account
hub / github.com/catboost/catboost / CheckStatus

Function CheckStatus

catboost/node-package/src/api_helpers.h:38–46  ·  view source on GitHub ↗

Checks that the return status of C API is true, returns error in JS exception otherwise.

Source from the content-addressed store, hash-verified

36
37// Checks that the return status of C API is true, returns error in JS exception otherwise.
38inline 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
49enum ENApiType {

Callers 6

TModelMethod · 0.85
LoadFullFromFileMethod · 0.85
SetPredictionTypeMethod · 0.85
EvaluateOnGPUMethod · 0.85

Calls 3

CheckNotNullFunction · 0.70
GetErrorStringFunction · 0.50
NewFunction · 0.50

Tested by

no test coverage detected