diff options
author | Zhu, Yongsheng <yongsheng.zhu@intel.com> | 2010-05-18 11:19:02 +0800 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2010-05-18 08:46:37 +0200 |
commit | b92b017407718be6ca8c2bec83e76a6ec582a4ea (patch) | |
tree | 7ff6e4a75fa14fb775ff5b57204b728232deeadd | |
parent | d32026ead2778edf88ea3b5922d90c000b449f6a (diff) |
D-Bus server + command line: return error code when failed(MBC #2193)mbc2193
When logdir can't be accessed, SyncContext handles the error and returns
an error status and command line only returns a false flag. So D-Bus
server has to handle the 'false' flag and throws an exception to
indicate this error to clients.
-rw-r--r-- | src/syncevo-dbus-server.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/syncevo-dbus-server.cpp b/src/syncevo-dbus-server.cpp index 96c13dc2..ae0acf8f 100644 --- a/src/syncevo-dbus-server.cpp +++ b/src/syncevo-dbus-server.cpp @@ -2023,7 +2023,10 @@ public: // exceptions must be handled (= printed) before returning, // so that our client gets the output try { - m_cmdline.run(); + if (!m_cmdline.run()) { + SE_THROW_EXCEPTION(DBusSyncException, "command line execution failure"); + } + } catch (...) { redirectPtr->flush(); throw; |