treelite
|
Error handling for C API. More...
#include <stdexcept>
Go to the source code of this file.
Macros | |
#define | API_BEGIN() try { |
Macro to guard beginning and end section of all functions. More... | |
#define | API_END() |
Every function starts with API_BEGIN(); and finishes with API_END() or API_END_HANDLE_ERROR. More... | |
#define | API_END_HANDLE_ERROR(Finalize) |
Every function starts with API_BEGIN(); and finishes with API_END() or API_END_HANDLE_ERROR() "Finalize" contains procedure to cleanup states when an error happens. More... | |
Functions | |
void | TreeliteAPISetLastError (char const *msg) |
Set the last error message needed by C API. More... | |
int | TreeliteAPIHandleException (std::exception const &e) |
handle Exception thrown out More... | |
Error handling for C API.
Copyright (c) 2017-2023 by Contributors
#define API_BEGIN | ( | ) | try { |
Macro to guard beginning and end section of all functions.
#define API_END | ( | ) |
Every function starts with API_BEGIN(); and finishes with API_END() or API_END_HANDLE_ERROR.
#define API_END_HANDLE_ERROR | ( | Finalize | ) |
Every function starts with API_BEGIN(); and finishes with API_END() or API_END_HANDLE_ERROR() "Finalize" contains procedure to cleanup states when an error happens.
|
inline |
handle Exception thrown out
e | Exception object |
void TreeliteAPISetLastError | ( | char const * | msg | ) |
Set the last error message needed by C API.
msg | Error message to set. |