diff options
Diffstat (limited to 'src/Core/Exception.h')
-rw-r--r-- | src/Core/Exception.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Core/Exception.h b/src/Core/Exception.h index 8e0342d..48688a4 100644 --- a/src/Core/Exception.h +++ b/src/Core/Exception.h @@ -43,18 +43,19 @@ class MAD_CORE_EXPORT Exception : public std::exception { }; private: - std::string where; + Core::String where; ErrorCode errorCode; long subCode; long subSubCode; + Core::String errorStr; std::string whatStr; void updateWhatStr(); public: - Exception(const std::string &where0, ErrorCode errorCode0 = SUCCESS, long subCode0 = 0, long subSubCode0 = 0) + Exception(const Core::String &where0, ErrorCode errorCode0 = SUCCESS, long subCode0 = 0, long subSubCode0 = 0) : where(where0), errorCode(errorCode0), subCode(subCode0), subSubCode(subSubCode0) { updateWhatStr(); } @@ -63,7 +64,7 @@ class MAD_CORE_EXPORT Exception : public std::exception { } virtual ~Exception() throw () {} - const std::string& getWhere() const {return where;} + const Core::String& getWhere() const {return where;} ErrorCode getErrorCode() const {return errorCode;} long getSubCode() const {return subCode;} long getSubSubCode() const {return subSubCode;} @@ -72,7 +73,11 @@ class MAD_CORE_EXPORT Exception : public std::exception { return whatStr.c_str(); } - operator bool() const { + const Core::String& toString() const throw () { + return errorStr; + } + + operator bool() const throw () { return (errorCode != SUCCESS); } }; |