32#if !defined(LUTOK_EXCEPTIONS_HPP)
33#define LUTOK_EXCEPTIONS_HPP
45class error :
public std::runtime_error {
47 explicit error(
const std::string&);
48 virtual ~error(
void)
throw();
58 explicit api_error(
const std::string&,
const std::string&);
76 const std::string&
filename(
void)
const;
Base exception for lua errors.
Definition: exceptions.hpp:45
virtual ~error(void)
Destructor for the error.
Definition: exceptions.cpp:48
Exception for errors raised by the Lua API library.
Definition: exceptions.hpp:53
const std::string & api_function(void) const
Gets the name of the Lua API function that caused this error.
Definition: exceptions.cpp:96
std::string _api_function
Name of the Lua C API function that caused the error.
Definition: exceptions.hpp:55
virtual ~api_error(void)
Destructor for the error.
Definition: exceptions.cpp:66
static api_error from_stack(state &, const std::string &)
Constructs a new api_error with the message on the top of the Lua stack.
Definition: exceptions.cpp:81
File not found error.
Definition: exceptions.hpp:68
const std::string & filename(void) const
Gets the name of the file that could not be found.
Definition: exceptions.cpp:123
virtual ~file_not_found_error(void)
Destructor for the error.
Definition: exceptions.cpp:114
std::string _filename
Name of the not-found file.
Definition: exceptions.hpp:70
A RAII model for the Lua state.
Definition: state.hpp:76