async changes to support 40749

https://gerrit.openbmc-project.xyz/c/openbmc/sdbusplus/+/40749

Is currently proposing changing these APIs to use C++ asio style
callbacks instead of the javascript callbacks.  This was the only usage
of these callbacks that I found, so this patchset is to move to the new
type.

Requires 40749 to be merged before this will build.

Signed-off-by: Ed Tanous <edtanous@google.com>
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: I1e950c096e36d2150a94c459e794bbac7303100d
diff --git a/src/sensor.cpp b/src/sensor.cpp
index 8b4fe01..26cadb7 100644
--- a/src/sensor.cpp
+++ b/src/sensor.cpp
@@ -35,14 +35,16 @@
     sdbusplus::asio::getProperty<double>(
         *bus, sensorId.service, sensorId.path,
         "xyz.openbmc_project.Sensor.Value", "Value",
-        [lock, id = sensorId,
-         weakSelf = weak_from_this()](boost::system::error_code ec) {
-            phosphor::logging::log<phosphor::logging::level::WARNING>(
-                "DBus 'GetProperty' call failed on Sensor Value",
-                phosphor::logging::entry("SENSOR_PATH=%s", id.path.c_str()),
-                phosphor::logging::entry("ERROR_CODE=%d", ec.value()));
-        },
-        [lock, weakSelf = weak_from_this()](double newValue) {
+        [lock, id = sensorId, weakSelf = weak_from_this()](
+            boost::system::error_code ec, double newValue) {
+            if (ec)
+            {
+                phosphor::logging::log<phosphor::logging::level::WARNING>(
+                    "DBus 'GetProperty' call failed on Sensor Value",
+                    phosphor::logging::entry("SENSOR_PATH=%s", id.path.c_str()),
+                    phosphor::logging::entry("ERROR_CODE=%d", ec.value()));
+                return;
+            }
             if (auto self = weakSelf.lock())
             {
                 self->updateValue(newValue);