diff options
author | Matt Spinler <spinler@us.ibm.com> | 2018-04-25 15:26:10 -0500 |
---|---|---|
committer | Matthew Barth <msbarth@us.ibm.com> | 2018-05-09 10:15:35 -0500 |
commit | ba7b5fea818f65949cd074de9322094d3c54fb7b (patch) | |
tree | 953b30c25fa2086bd56f2af340965adbd8244f55 /control/functor.hpp | |
parent | 84f105b7f83bcafc28f3b9c30592cd754af44719 (diff) | |
download | phosphor-fan-presence-ba7b5fea818f65949cd074de9322094d3c54fb7b.tar.gz phosphor-fan-presence-ba7b5fea818f65949cd074de9322094d3c54fb7b.zip |
Throw custom exceptions on D-Bus method failures
All 3 fan applications - control, monitor, and presence
have cases where it is expected that a getProperty call
may fail because a sensor is missing. While the applications
already handle this, the InternalFailure exception that was
being thrown by the underlying call generates log entries
that make it look like something bad happened.
The custom exceptions now being thrown do not log anything on
creation, but store all of the failing information so that
any callers could still log the info if they wanted to.
Tested: Boot a water cooled Witherspoon and see the fan presence
and monitor applications not look like they are
failing. Boot a system without the fan hwmon running,
and see fan-control-init still show the fails.
Change-Id: Ifd8ad6e3deb492bbaf33f12c7258125dce1e5ea8
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Diffstat (limited to 'control/functor.hpp')
-rw-r--r-- | control/functor.hpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/control/functor.hpp b/control/functor.hpp index 0a2b955..2ca047c 100644 --- a/control/functor.hpp +++ b/control/functor.hpp @@ -15,8 +15,6 @@ class Zone; using namespace phosphor::fan; using namespace sdbusplus::bus::match; using namespace phosphor::logging; -using InternalFailure = sdbusplus::xyz::openbmc_project::Common:: - Error::InternalFailure; /** * @brief Create a handler function object @@ -115,7 +113,7 @@ struct PropertyChanged _property); _handler(zone, std::forward<T>(val)); } - catch (const InternalFailure& ife) + catch (const util::DBusError& e) { // Property will not be used unless a property changed // signal message is received for this property. @@ -397,7 +395,7 @@ struct NameOwnerChanged "NameHasOwner", name); } - catch (const InternalFailure& ife) + catch (const util::DBusMethodError& e) { // Failed to get service name owner state hasOwner = false; |