Treelite
c_api_error.cc
Go to the documentation of this file.
1 
8 #include <treelite/c_api_error.h>
9 #include <string>
10 
12  std::string last_error;
13 };
14 
16 
17 const char* TreeliteGetLastError() {
18  return TreeliteAPIErrorStore::Get()->last_error.c_str();
19 }
20 
21 void TreeliteAPISetLastError(const char* msg) {
22  TreeliteAPIErrorStore::Get()->last_error = msg;
23 }
const char * TreeliteGetLastError()
display last error; can be called by multiple threads Note. Each thread will get the last error occur...
Definition: c_api_error.cc:17
Helper class for thread-local storage.
Error handling for C API.
Definition: c_api_error.cc:11
void TreeliteAPISetLastError(const char *msg)
Set the last error message needed by C API.
Definition: c_api_error.cc:21
A thread-local storage.
Definition: thread_local.h:17