diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-09-01 14:40:04 +0200 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-09-01 14:40:04 +0200 |
commit | eec4070031b2fae76cae29f1f8227b78a6481f2f (patch) | |
tree | 2b62318fa932687c8ed462ff25a58e477ef72e29 | |
parent | d3caf407e802d5decf26627491a5f4d54966191e (diff) | |
download | abrt-eec4070031b2fae76cae29f1f8227b78a6481f2f.tar.gz abrt-eec4070031b2fae76cae29f1f8227b78a6481f2f.tar.xz abrt-eec4070031b2fae76cae29f1f8227b78a6481f2f.zip |
DBUS: return proper ErrorMessage if report fails
-rw-r--r-- | src/Daemon/CommLayerServerDBus.cpp | 12 | ||||
-rw-r--r-- | src/Daemon/CommLayerServerDBus.h | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index 1e159c88..9b38824c 100644 --- a/src/Daemon/CommLayerServerDBus.cpp +++ b/src/Daemon/CommLayerServerDBus.cpp @@ -97,7 +97,17 @@ DBus::Message CCommLayerServerDBus::_Report_stub(const DBus::CallMessage &call) const char* sender = call.sender(); unsigned long unix_uid = m_pConn->sender_unix_uid(sender); VERB1 log("got %s(...) call from %s, uid %lu", "Report", sender, unix_uid); - report_status_t argout1 = Report(argin1, to_string(unix_uid)); + report_status_t argout1; + try + { + argout1 = Report(argin1, to_string(unix_uid)); + } + catch(CABRTException &e) + { + DBus::ErrorMessage reply(call, DBUS_ERROR_FAILED, e.what().c_str()); + return reply; + } + DBus::ReturnMessage reply(call); DBus::MessageIter wi = reply.writer(); diff --git a/src/Daemon/CommLayerServerDBus.h b/src/Daemon/CommLayerServerDBus.h index ff8cb0e9..8824ca39 100644 --- a/src/Daemon/CommLayerServerDBus.h +++ b/src/Daemon/CommLayerServerDBus.h @@ -2,6 +2,7 @@ #define COMMLAYERSERVERDBUS_H_ #include <dbus-c++/dbus.h> +#include <dbus/dbus.h> #include <dbus-c++/glib-integration.h> #include "CommLayerServer.h" |