skip creating sensors when its dbus is not present

In the current state, we attempt to create a sensor PDR even if the
D-Bus object that is being modeled as a sensor is absent at the time
of creation.

However, this behavior may not be beneficial, as assuming that the
D-Bus backend will magically appear later does not necessarily mean
that we will be able to process it and send sensor events, since we
only process the JSON files only during the first getPDR request.
Therefore, it would be more efficient to skip creating a sensor during
the absence of the D-Bus object.

This commit also addresses an error trace by including the dbus object
path when it is not present on the system, rather than the opaque sensor
id number which does not provide contextual information and may make it
harder to diagnose issues.

Change-Id: I5747319f15c212ab6654b9d7accfce28782c9565
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
diff --git a/libpldmresponder/pdr_state_sensor.hpp b/libpldmresponder/pdr_state_sensor.hpp
index f2d89ba..72b47ff 100644
--- a/libpldmresponder/pdr_state_sensor.hpp
+++ b/libpldmresponder/pdr_state_sensor.hpp
@@ -172,8 +172,9 @@
             catch (const std::exception& e)
             {
                 error(
-                    "D-Bus object path does not exist, sensor ID: {SENSOR_ID}",
-                    "SENSOR_ID", static_cast<uint16_t>(pdr->sensor_id));
+                    "Failed to create sensor PDR, D-Bus object '{PATH}' returned {ERROR}",
+                    "PATH", objectPath, "ERROR", e);
+                continue;
             }
 
             dbusMappings.emplace_back(std::move(dbusMapping));