summaryrefslogtreecommitdiffstats
path: root/src/Common/RequestHandlers
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-05-22 14:21:06 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-05-22 14:21:06 +0200
commit0480576d43fb7ddcc16de9dab0619a1424f129fd (patch)
tree633f11b0ee7b9bfe20478cd47e8d6ec397627ad5 /src/Common/RequestHandlers
parent264cd7947d7291f78065f12824523ba6178a9936 (diff)
downloadmad-0480576d43fb7ddcc16de9dab0619a1424f129fd.tar
mad-0480576d43fb7ddcc16de9dab0619a1424f129fd.zip
SystemBackend ?berarbeitet
Diffstat (limited to 'src/Common/RequestHandlers')
-rw-r--r--src/Common/RequestHandlers/FSInfoRequestHandler.cpp11
-rw-r--r--src/Common/RequestHandlers/StatusRequestHandler.cpp11
2 files changed, 15 insertions, 7 deletions
diff --git a/src/Common/RequestHandlers/FSInfoRequestHandler.cpp b/src/Common/RequestHandlers/FSInfoRequestHandler.cpp
index 663e512..94756b5 100644
--- a/src/Common/RequestHandlers/FSInfoRequestHandler.cpp
+++ b/src/Common/RequestHandlers/FSInfoRequestHandler.cpp
@@ -47,7 +47,9 @@ void FSInfoRequestHandler::handlePacket(const XmlPacket &packet) {
XmlPacket ret;
- if(SystemManager::get()->getFSInfo(&fsInfo)) {
+ try {
+ SystemManager::get()->getFSInfo(&fsInfo);
+
ret.setType("OK");
ret.addList("filesystems");
@@ -62,9 +64,12 @@ void FSInfoRequestHandler::handlePacket(const XmlPacket &packet) {
entry.add("availableSize", fs->available);
}
}
- else {
+ catch(Net::Exception e) {
ret.setType("Error");
- ret.add("ErrorCode", Net::Exception::NOT_IMPLEMENTED);
+ ret.add("ErrorCode", e.getErrorCode());
+ ret.add("SubCode", e.getSubCode());
+ ret.add("SubSubCode", e.getSubSubCode());
+ ret.add("Where", e.getWhere());
}
sendPacket(ret);
diff --git a/src/Common/RequestHandlers/StatusRequestHandler.cpp b/src/Common/RequestHandlers/StatusRequestHandler.cpp
index 94ec5b2..c564680 100644
--- a/src/Common/RequestHandlers/StatusRequestHandler.cpp
+++ b/src/Common/RequestHandlers/StatusRequestHandler.cpp
@@ -50,12 +50,15 @@ void StatusRequestHandler::handlePacket(const XmlPacket &packet) {
float loadAvg1, loadAvg5, loadAvg15;
+ XmlPacket ret;
- SystemManager::get()->getUptimeInfo(&uptime, &idleTime);
- SystemManager::get()->getMemoryInfo(&totalMem, &freeMem, &totalSwap, &freeSwap);
- SystemManager::get()->getLoadInfo(&currentLoad, &nProcesses, &loadAvg1, &loadAvg5, &loadAvg15);
+ try {
+ SystemManager::get()->getUptimeInfo(&uptime, &idleTime);
+ SystemManager::get()->getMemoryInfo(&totalMem, &freeMem, &totalSwap, &freeSwap);
+ SystemManager::get()->getLoadInfo(&currentLoad, &nProcesses, &loadAvg1, &loadAvg5, &loadAvg15);
+ }
+ catch(Net::Exception e) {}
- XmlPacket ret;
ret.setType("OK");
ret.add("uptime", uptime);