diff options
Diffstat (limited to 'src/virtualmachine/Exceptions.h')
| -rw-r--r-- | src/virtualmachine/Exceptions.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/virtualmachine/Exceptions.h b/src/virtualmachine/Exceptions.h index 2dca461..fbc4341 100644 --- a/src/virtualmachine/Exceptions.h +++ b/src/virtualmachine/Exceptions.h @@ -7,11 +7,16 @@ namespace vm { class RuntimeException: public std::exception { + char * error; public: - RuntimeException() {} + RuntimeException() : error(NULL) {} + RuntimeException(char * message) : error(strdup(message)) {} const char * what() const throw() { - return "VirtualMachine runtime exception"; + if(error) + return error; + else + return "VirtualMachine runtime exception"; } ~RuntimeException() throw() {}; }; @@ -56,6 +61,21 @@ namespace vm ~AccessViolationException() throw() {}; }; + class JITException: public RuntimeException + { + char * _what; + public: + JITException(const char * what2) + { + _what = strdup(what2); + } + const char * what() const throw() + { + return _what; + } + ~JITException() throw() {}; + }; + class OutOfMemoryException: public RuntimeException { public: |
