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.cpp38
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();
}
}