mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix script error reporting a bit
This commit is contained in:
parent
9344816bd6
commit
581f950e10
5 changed files with 48 additions and 8 deletions
21
src/script.h
21
src/script.h
|
@ -20,8 +20,27 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#ifndef SCRIPT_HEADER
|
||||
#define SCRIPT_HEADER
|
||||
|
||||
#include <exception>
|
||||
#include <string>
|
||||
|
||||
class LuaError : public std::exception
|
||||
{
|
||||
public:
|
||||
LuaError(const std::string &s)
|
||||
{
|
||||
m_s = "LuaError: ";
|
||||
m_s += s;
|
||||
}
|
||||
virtual ~LuaError() throw()
|
||||
{}
|
||||
virtual const char * what() const throw()
|
||||
{
|
||||
return m_s.c_str();
|
||||
}
|
||||
std::string m_s;
|
||||
};
|
||||
|
||||
typedef struct lua_State lua_State;
|
||||
//#include <string>
|
||||
|
||||
lua_State* script_init();
|
||||
void script_deinit(lua_State *L);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue