C4AulError: derive from std::exception

objectmenu
Nicolas Hake 2016-01-23 00:57:30 +01:00
parent 24839204ce
commit 9a9bcd0568
2 changed files with 7 additions and 1 deletions

View File

@ -36,6 +36,11 @@ void C4AulError::show()
DebugLog(sMessage.getData());
}
const char *C4AulError::what() const noexcept
{
return sMessage ? sMessage.getData() : "(unknown error)";
}
C4AulScript::C4AulScript()
{
// not compiled

View File

@ -29,7 +29,7 @@
#define C4AUL_MAX_Identifier 100 // max length of function identifiers
// generic C4Aul error class
class C4AulError
class C4AulError : public std::exception
{
protected:
StdCopyStrBuf sMessage;
@ -38,6 +38,7 @@ public:
bool shown;
C4AulError();
virtual ~C4AulError() { } // destructor
virtual const char *what() const noexcept;
void show(); // present error message
};