summaryrefslogtreecommitdiff
path: root/src/script.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-12-02 22:49:54 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-12-02 22:49:54 +0200
commit581f950e10b40f2af4ede56c3fa78f13eccb610b (patch)
tree5efd4bd3b304edb7e850cf2ffb8803439513385b /src/script.h
parent9344816bd6c40603729256b454e2f171902b02e5 (diff)
downloadminetest-581f950e10b40f2af4ede56c3fa78f13eccb610b.tar.gz
minetest-581f950e10b40f2af4ede56c3fa78f13eccb610b.tar.bz2
minetest-581f950e10b40f2af4ede56c3fa78f13eccb610b.zip
Fix script error reporting a bit
Diffstat (limited to 'src/script.h')
-rw-r--r--src/script.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/script.h b/src/script.h
index ce697bc50..6da95acf7 100644
--- a/src/script.h
+++ b/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);