diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-09-27 23:51:34 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-09-27 23:51:34 +0200 |
commit | a7a285eb61dd83afc892bc1d64ffe14b9f1426a3 (patch) | |
tree | 08d2efcaec46e5f5702d9e336a0e8ba7e636aff9 /src/Core/Exception.cpp | |
parent | b40ba0cf91603b695f1f2380cbd39966a458f22f (diff) | |
download | mad-a7a285eb61dd83afc892bc1d64ffe14b9f1426a3.tar mad-a7a285eb61dd83afc892bc1d64ffe14b9f1426a3.zip |
Completely migrate to Unicode String class
Diffstat (limited to 'src/Core/Exception.cpp')
-rw-r--r-- | src/Core/Exception.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/Core/Exception.cpp b/src/Core/Exception.cpp index 220e6fd..338bd7c 100644 --- a/src/Core/Exception.cpp +++ b/src/Core/Exception.cpp @@ -25,60 +25,62 @@ namespace Mad { namespace Core { void Exception::updateWhatStr() { - if(where.empty()) - whatStr.clear(); + if(where.isEmpty()) + errorStr.remove(); else - whatStr = where + ": "; + errorStr = where + ": "; switch(errorCode) { case SUCCESS: - whatStr += "Success"; + errorStr += "Success"; break; case UNEXPECTED_PACKET: - whatStr += "An unexpected packet was received"; + errorStr += "An unexpected packet was received"; break; case INVALID_ACTION: - whatStr += "The action is invalid"; + errorStr += "The action is invalid"; break; case NOT_AVAILABLE: - whatStr += "Not available"; + errorStr += "Not available"; break; case NOT_FINISHED: - whatStr += "Not finished"; + errorStr += "Not finished"; break; case NOT_IMPLEMENTED: - whatStr += "Not implemented"; + errorStr += "Not implemented"; break; case NOT_FOUND: - whatStr += "Not found"; + errorStr += "Not found"; break; case INVALID_INPUT: - whatStr += "Invalid input"; + errorStr += "Invalid input"; break; case PERMISSION: - whatStr += "Permission denied"; + errorStr += "Permission denied"; break; case INTERNAL_ERRNO: - whatStr += std::strerror(subCode); + errorStr += std::strerror(subCode); break; case INVALID_ADDRESS: - whatStr += "Invalid address"; + errorStr += "Invalid address"; break; case ALREADY_IDENTIFIED: - whatStr += "The host is already identified"; + errorStr += "The host is already identified"; break; case UNKNOWN_DAEMON: whatStr += "The daemon is unknown"; break; case DUPLICATE_ENTRY: - whatStr += "Duplicate entry"; + errorStr += "Duplicate entry"; break; case AUTHENTICATION: - whatStr += "Authentication failure"; + errorStr += "Authentication failure"; break; default: - whatStr += "Unknown error"; + errorStr += "Unknown error"; } + + whatStr = errorStr.toLocale(); } } |