From a7a285eb61dd83afc892bc1d64ffe14b9f1426a3 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 27 Sep 2009 23:51:34 +0200 Subject: Completely migrate to Unicode String class --- src/Core/Exception.cpp | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'src/Core/Exception.cpp') 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(); } } -- cgit v1.2.3