Treelite
Functions
c_api_error.cc File Reference

C error handling. More...

#include <treelite/thread_local.h>
#include <treelite/c_api_error.h>
#include <string>
Include dependency graph for c_api_error.cc:

Go to the source code of this file.

Functions

const char * TreeliteGetLastError ()
 display last error; can be called by multiple threads Note. Each thread will get the last error occured in its own context. More...
 
void TreeliteAPISetLastError (const char *msg)
 Set the last error message needed by C API. More...
 

Detailed Description

C error handling.

Copyright (c) 2017-2021 by Contributors

Author
Hyunsu Cho

Definition in file c_api_error.cc.

Function Documentation

◆ TreeliteAPISetLastError()

void TreeliteAPISetLastError ( const char *  msg)

Set the last error message needed by C API.

Parameters
msgThe error message to set.

Definition at line 25 of file c_api_error.cc.

◆ TreeliteGetLastError()

const char* TreeliteGetLastError ( void  )

display last error; can be called by multiple threads Note. Each thread will get the last error occured in its own context.

Returns
error string

Definition at line 21 of file c_api_error.cc.