ArtMOO
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
G:/dev/qt/MOO/ServerCore/mooexception.h
Go to the documentation of this file.
00001 #ifndef MOOEXCEPTION_H
00002 #define MOOEXCEPTION_H
00003 
00004 #include <lua.hpp>
00005 
00006 #include "mooglobal.h"
00007 #include <QDebug>
00008 
00009 class mooException
00010 {
00011 public:
00012         mooException( mooError pError, const QString &pMessage ) : mError( pError ), mMessage( pMessage )
00013         {
00014         }
00015 
00016         mooException( mooError pError, const char *pMessage ) : mError( pError ), mMessage( pMessage )
00017         {
00018         }
00019 
00020         void lua_pushexception( lua_State *L )
00021         {
00022                 qDebug() << mMessage;
00023 
00024                 luaL_where( L, 1 );
00025                 lua_pushstring( L, mMessage.toAscii() );
00026                 lua_concat( L, 2 );
00027         }
00028 
00029 public:
00030         const mooError  mError;
00031         const QString   mMessage;
00032 };
00033 
00034 #endif // MOOEXCEPTION_H