summaryrefslogtreecommitdiffstats
path: root/sdbusplus.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'sdbusplus.hpp')
-rw-r--r--sdbusplus.hpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/sdbusplus.hpp b/sdbusplus.hpp
index 3a6cd65..41c7fe2 100644
--- a/sdbusplus.hpp
+++ b/sdbusplus.hpp
@@ -149,14 +149,19 @@ class SDBusPlus
interface.c_str(),
method.c_str());
reqMsg.append(std::forward<Args>(args)...);
- auto respMsg = bus.call(reqMsg);
-
- if (respMsg.is_method_error())
+ try
+ {
+ auto respMsg = bus.call(reqMsg);
+ if (respMsg.is_method_error())
+ {
+ throw DBusMethodError{busName, path, interface, method};
+ }
+ return respMsg;
+ }
+ catch (const sdbusplus::exception::SdBusError&)
{
throw DBusMethodError{busName, path, interface, method};
}
-
- return respMsg;
}
/** @brief Invoke a method. */
OpenPOWER on IntegriCloud