diff options
Diffstat (limited to 'monitor/tach_sensor.cpp')
-rw-r--r-- | monitor/tach_sensor.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/monitor/tach_sensor.cpp b/monitor/tach_sensor.cpp index 80eb974..2ece054 100644 --- a/monitor/tach_sensor.cpp +++ b/monitor/tach_sensor.cpp @@ -14,6 +14,9 @@ * limitations under the License. */ #include <phosphor-logging/log.hpp> +#include <phosphor-logging/elog.hpp> +#include <phosphor-logging/elog-errors.hpp> +#include <xyz/openbmc_project/Common/error.hpp> #include "fan.hpp" #include "tach_sensor.hpp" #include "../utility.hpp" @@ -25,6 +28,10 @@ namespace fan namespace monitor { +using namespace phosphor::logging; +using InternalFailure = sdbusplus::xyz::openbmc_project::Common:: + Error::InternalFailure; + constexpr auto PROPERTY_INTF = "org.freedesktop.DBus.Properties"; constexpr auto FAN_SENSOR_PATH = "/xyz/openbmc_project/sensors/fan_tach/"; constexpr auto FAN_SENSOR_CONTROL_INTF = "xyz.openbmc_project.Control.FanSpeed"; @@ -65,9 +72,9 @@ static void readProperty(const std::string& interface, auto reply = bus.call(method); if (reply.is_method_error()) { - throw std::runtime_error( - "Error in property get call for path " + - path); + log<level::ERR>("Error in property get call", + entry("PATH=%s", path.c_str())); + elog<InternalFailure>(); } reply.read(property); |