diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-08-24 03:06:32 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-08-24 03:06:32 +0200 |
commit | 84a5ceeb7db03d75425d72e8a23a0bb0f267bc01 (patch) | |
tree | 7a7702429a7cdbc06144b2141eb80ee2aa462d39 /src/Core/Exception.cpp | |
parent | 415cd36477e152c12f91a10ad61bb719373cd9d1 (diff) | |
download | mad-84a5ceeb7db03d75425d72e8a23a0bb0f267bc01.tar mad-84a5ceeb7db03d75425d72e8a23a0bb0f267bc01.zip |
Hash-Klasse hinzugefügt
Diffstat (limited to 'src/Core/Exception.cpp')
-rw-r--r-- | src/Core/Exception.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/Core/Exception.cpp b/src/Core/Exception.cpp index 0029613..3e9da4d 100644 --- a/src/Core/Exception.cpp +++ b/src/Core/Exception.cpp @@ -24,45 +24,45 @@ namespace Mad { namespace Core { -std::string Exception::strerror() const { - std::string ret; - - if(!where.empty()) - ret = where + ": "; +void Exception::updateWhatStr() { + if(where.empty()) + whatStr.clear(); + else + whatStr = where + ": "; switch(errorCode) { case SUCCESS: - return ret + "Success"; + whatStr += "Success"; case UNEXPECTED_PACKET: - return ret + "An unexpected packet was received"; + whatStr += "An unexpected packet was received"; case INVALID_ACTION: - return ret + "The action is invalid"; + whatStr += "The action is invalid"; case NOT_AVAILABLE: - return ret + "Not available"; + whatStr += "Not available"; case NOT_FINISHED: - return ret + "Not finished"; + whatStr += "Not finished"; case NOT_IMPLEMENTED: - return ret + "Not implemented"; + whatStr += "Not implemented"; case NOT_FOUND: - return ret + "Not found"; + whatStr += "Not found"; case INVALID_INPUT: - return ret + "Invalid input"; + whatStr += "Invalid input"; case PERMISSION: - return ret + "Permission denied"; + whatStr += "Permission denied"; case INTERNAL_ERRNO: - return ret + std::strerror(subCode); + whatStr += std::strerror(subCode); case INVALID_ADDRESS: - return ret + "Invalid address"; + whatStr += "Invalid address"; case ALREADY_IDENTIFIED: - return ret + "The host is already identified"; + whatStr += "The host is already identified"; case UNKNOWN_DAEMON: - return ret + "The daemon is unknown"; + whatStr += "The daemon is unknown"; case DUPLICATE_ENTRY: - return ret + "Duplicate entry"; + whatStr += "Duplicate entry"; case AUTHENTICATION: - return ret + "Authentication failure"; + whatStr += "Authentication failure"; default: - return ret + "Unknown error"; + whatStr += "Unknown error"; } } |