From 84a5ceeb7db03d75425d72e8a23a0bb0f267bc01 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 24 Aug 2009 03:06:32 +0200 Subject: =?UTF-8?q?Hash-Klasse=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Core/Exception.cpp | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/Core/Exception.cpp') 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"; } } -- cgit v1.2.3