diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/method.hpp | 21 | ||||
-rw-r--r-- | src/test/Makefile.am | 1 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/method.hpp b/src/method.hpp index 86326b6..f8f8f51 100644 --- a/src/method.hpp +++ b/src/method.hpp @@ -3,6 +3,7 @@ #include "callback.hpp" #include <experimental/tuple> +#include <phosphor-logging/log.hpp> namespace phosphor { @@ -13,6 +14,8 @@ namespace monitoring namespace detail { +using namespace phosphor::logging; + /** @class CallDBusMethod * @brief Provide explicit call forwarding to * DBusInterface::callMethodNoReply. @@ -27,8 +30,22 @@ struct CallDBusMethod const std::string& iface, const std::string& method, MethodArgs&&... args) { - DBusInterface::callMethodNoReply(bus, path, iface, method, - std::forward<MethodArgs>(args)...); + try + { + DBusInterface::callMethodNoReply(bus, path, iface, method, + std::forward<MethodArgs>(args)...); + } + catch (const sdbusplus::exception::SdBusError& e) + { + // clang-format off + log<level::ERR>("Unable to call DBus method", + entry("BUS=%s", bus.c_str(), + "PATH=%s", path.c_str(), + "IFACE=%s", iface.c_str(), + "METHOD=%s", method.c_str(), + "ERROR=%s", e.what())); + // clang-format on + } } }; } // namespace detail diff --git a/src/test/Makefile.am b/src/test/Makefile.am index cbe9b82..3799890 100644 --- a/src/test/Makefile.am +++ b/src/test/Makefile.am @@ -12,7 +12,6 @@ BUILT_SOURCES = CLEANFILES = TESTS = $(check_PROGRAMS) -XFAIL_TESTS = callbacktest check_PROGRAMS += pathgentest pathgentest_SOURCES = \ |