#include <squirrel_error.hpp>
Inherits std::exception.
Public Member Functions | |
SquirrelError (HSQUIRRELVM v, const std::string &message) throw () | |
virtual | ~SquirrelError () throw () |
const char * | what () const throw () |
Private Attributes | |
std::string | message |
Definition at line 29 of file squirrel_error.hpp.
scripting::SquirrelError::SquirrelError | ( | HSQUIRRELVM | v, | |
const std::string & | message | |||
) | throw () |
Definition at line 22 of file squirrel_error.cpp.
00022 : 00023 message() 00024 { 00025 std::ostringstream msg; 00026 msg << "Squirrel error: " << message << " ("; 00027 const char* lasterr; 00028 sq_getlasterror(v); 00029 if(sq_gettype(v, -1) != OT_STRING) 00030 { 00031 lasterr = "no error info"; 00032 } 00033 else 00034 { 00035 sq_getstring(v, -1, &lasterr); 00036 } 00037 msg << lasterr << ")"; 00038 sq_pop(v, 1); 00039 this->message = msg.str(); 00040 }
scripting::SquirrelError::~SquirrelError | ( | ) | throw () [virtual] |
const char * scripting::SquirrelError::what | ( | ) | const throw () |
Definition at line 46 of file squirrel_error.cpp.
References message.
00047 { 00048 return message.c_str(); 00049 }
std::string scripting::SquirrelError::message [private] |