diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2009-05-22 14:21:06 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2009-05-22 14:21:06 +0200 |
commit | 0480576d43fb7ddcc16de9dab0619a1424f129fd (patch) | |
tree | 633f11b0ee7b9bfe20478cd47e8d6ec397627ad5 /src/Daemon | |
parent | 264cd7947d7291f78065f12824523ba6178a9936 (diff) | |
download | mad-0480576d43fb7ddcc16de9dab0619a1424f129fd.tar mad-0480576d43fb7ddcc16de9dab0619a1424f129fd.zip |
SystemBackend ?berarbeitet
Diffstat (limited to 'src/Daemon')
-rw-r--r-- | src/Daemon/RequestHandlers/CommandRequestHandler.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/Daemon/RequestHandlers/CommandRequestHandler.cpp b/src/Daemon/RequestHandlers/CommandRequestHandler.cpp index 952837c..f8b7c31 100644 --- a/src/Daemon/RequestHandlers/CommandRequestHandler.cpp +++ b/src/Daemon/RequestHandlers/CommandRequestHandler.cpp @@ -45,21 +45,22 @@ void CommandRequestHandler::handlePacket(const Common::XmlPacket &packet) { std::string command = packet["command"]; - bool ok; - - if(command == "reboot") - ok = Common::SystemManager::get()->shutdown(); - else - ok = Common::SystemManager::get()->reboot(); - Common::XmlPacket ret; - if(ok) { + try { + if(command == "reboot") + Common::SystemManager::get()->shutdown(); + else + Common::SystemManager::get()->reboot(); + ret.setType("OK"); } - 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); |