summaryrefslogtreecommitdiffstats
path: root/cooling-type/main.cpp
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2018-05-10 11:39:46 -0500
committerMatthew Barth <msbarth@us.ibm.com>2018-05-17 12:13:36 -0500
commit17792cda3aa968116998391ef0982d7a9989c8da (patch)
treeb1466b3ba8b9bb15916bcf3b8f15a58b1958ef8e /cooling-type/main.cpp
parent26e96122ee89ccaa2de317deb70af5dc5011f48f (diff)
downloadphosphor-fan-presence-17792cda3aa968116998391ef0982d7a9989c8da.tar.gz
phosphor-fan-presence-17792cda3aa968116998391ef0982d7a9989c8da.zip
cooling-type: Use lookupAndCallMethod
Have phosphor-cooling-type fail with a DBusMethodError exception when a failure occurs on updating inventory. Resolves: openbmc/openbmc#2628 Tested: Cooling type properties still set correctly Change-Id: Ia7e3379fc7d75c70e9c71d4f940f9da84b9f5774 Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Diffstat (limited to 'cooling-type/main.cpp')
-rw-r--r--cooling-type/main.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/cooling-type/main.cpp b/cooling-type/main.cpp
index 288f1b9..f690f80 100644
--- a/cooling-type/main.cpp
+++ b/cooling-type/main.cpp
@@ -4,6 +4,7 @@
#include <phosphor-logging/log.hpp>
#include "argument.hpp"
#include "cooling_type.hpp"
+#include "sdbusplus.hpp"
using namespace phosphor::cooling::type;
using namespace phosphor::fan::util;
@@ -63,7 +64,15 @@ int main(int argc, char* argv[])
coolingType.updateInventory(objpath);
rc = 0;
}
-
+ catch (DBusMethodError& dme)
+ {
+ rc = -1;
+ log<level::ERR>("Uncaught DBus method failure exception",
+ entry("BUSNAME=%s", dme.busName.c_str()),
+ entry("PATH=%s", dme.path.c_str()),
+ entry("INTERFACE=%s", dme.interface.c_str()),
+ entry("METHOD=%s", dme.method.c_str()));
+ }
catch (std::exception& err)
{
rc = -1;
OpenPOWER on IntegriCloud