Exception for errors raised by the Lua API library. More...
#include <exceptions.hpp>
Public Member Functions | |
api_error (const std::string &, const std::string &) | |
Constructs a new error. | |
virtual | ~api_error (void) throw () |
Destructor for the error. | |
const std::string & | api_function (void) const |
Gets the name of the Lua API function that caused this error. | |
Static Public Member Functions | |
static api_error | from_stack (state &, const std::string &) |
Constructs a new api_error with the message on the top of the Lua stack. | |
Private Attributes | |
std::string | _api_function |
Name of the Lua C API function that caused the error. |
Exception for errors raised by the Lua API library.
lutok::api_error::api_error | ( | const std::string & | api_function_, |
const std::string & | message | ||
) | [explicit] |
Constructs a new error.
api_function_ | The name of the API function that caused the error. |
message | The plain-text error message provided by Lua. |
const std::string & lutok::api_error::api_function | ( | void | ) | const |
Gets the name of the Lua API function that caused this error.
lutok::api_error lutok::api_error::from_stack | ( | state & | state_, |
const std::string & | api_function_ | ||
) | [static] |
Constructs a new api_error with the message on the top of the Lua stack.
state_ | The Lua state. |
api_function_ | The name of the Lua API function that caused the error. |