summaryrefslogtreecommitdiffstats
path: root/src/Core/Exception.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Core/Exception.cpp')
-rw-r--r--src/Core/Exception.cpp42
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";
}
}