/*! * Copyright (c) 2017 by Contributors * \file c_api_error.cc * \author Philip Cho * \brief C error handling */ #include #include "./c_api_error.h" struct TreeliteAPIErrorEntry { std::string last_error; }; typedef dmlc::ThreadLocalStore TreeliteAPIErrorStore; const char* TreeliteGetLastError() { return TreeliteAPIErrorStore::Get()->last_error.c_str(); } void TreeliteAPISetLastError(const char* msg) { TreeliteAPIErrorStore::Get()->last_error = msg; }