tibia-client/src/framework/luascript/luaexception.h

35 lines
760 B
C
Raw Normal View History

#ifndef LUAEXCEPTION_H
#define LUAEXCEPTION_H
2011-08-15 16:06:15 +02:00
#include "declarations.h"
class LuaException : public std::exception
{
public:
LuaException(const std::string& error, int traceLevel = -1);
2011-08-14 04:09:11 +02:00
virtual ~LuaException() throw() { }
void generateLuaErrorMessage(const std::string& error, int traceLevel);
virtual const char* what() const throw() { return m_what.c_str(); }
protected:
LuaException() { }
std::string m_what;
};
2011-08-14 04:09:11 +02:00
class LuaBadNumberOfArgumentsException : public LuaException
{
public:
LuaBadNumberOfArgumentsException(int expected = -1, int got = -1);
};
2011-08-14 04:09:11 +02:00
class LuaBadValueCastException : public LuaException
{
public:
2011-08-14 04:09:11 +02:00
LuaBadValueCastException(const std::string& luaTypeName, const std::string& cppTypeName);
};
#endif