From 6b4071c12bdcc3bd20e72a7bd2eed19ff14b97af Mon Sep 17 00:00:00 2001 From: Zhikui Ren Date: Wed, 12 May 2021 19:11:08 -0700 Subject: [PATCH] allow dbus sensors without thresholds catch dbus exceptions when query for thresholds interfaces. log messages and continue. Signed-off-by: Zhikui Ren --- dbus/dbusconfiguration.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dbus/dbusconfiguration.cpp b/dbus/dbusconfiguration.cpp index 55151d3..fd7a138 100644 --- a/dbus/dbusconfiguration.cpp +++ b/dbus/dbusconfiguration.cpp @@ -286,13 +286,15 @@ void populatePidInfo( { interface = thresholds::criticalInterface; } - const std::string& path = sensorConfig.at(info.inputs.front()).readPath; - DbusHelper helper(sdbusplus::bus::new_system()); - std::string service = helper.getService(interface, path); double reading = 0; try { + const std::string& path = sensorConfig.at(info.inputs.front()).readPath; + + DbusHelper helper(sdbusplus::bus::new_system()); + std::string service = helper.getService(interface, path); + helper.getProperty(service, path, interface, *thresholdProperty, reading); } -- 2.17.1