2011-07-27 01:13:27 +02:00
|
|
|
#ifndef LUAEXCEPTION_H
|
|
|
|
#define LUAEXCEPTION_H
|
|
|
|
|
2011-08-15 16:06:15 +02:00
|
|
|
#include "declarations.h"
|
2011-07-27 01:13:27 +02:00
|
|
|
|
|
|
|
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() { }
|
2011-07-27 01:13:27 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
{
|
2011-07-27 01:13:27 +02:00
|
|
|
public:
|
|
|
|
LuaBadNumberOfArgumentsException(int expected = -1, int got = -1);
|
|
|
|
};
|
|
|
|
|
2011-08-14 04:09:11 +02:00
|
|
|
class LuaBadValueCastException : public LuaException
|
|
|
|
{
|
2011-07-27 01:13:27 +02:00
|
|
|
public:
|
2011-08-14 04:09:11 +02:00
|
|
|
LuaBadValueCastException(const std::string& luaTypeName, const std::string& cppTypeName);
|
2011-07-27 01:13:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|