requester: Adds a missing try-catch
A try-catch in propertiesChangedCb was missing. Now it's added.
Tested: Successfully restarted pldmd on a machine with same specs as the one in the bug. https://paste.googleplex.com/5838230064857088
Google-Bug-Id: 464928106
Change-Id: Ic7f3d210dddaa9857841a6f53c9e26db7fae3e92
Signed-off-by: Luka Strizic <lstrz@google.com>
diff --git a/requester/mctp_endpoint_discovery.cpp b/requester/mctp_endpoint_discovery.cpp
index db764bf..0afe939 100644
--- a/requester/mctp_endpoint_discovery.cpp
+++ b/requester/mctp_endpoint_discovery.cpp
@@ -310,8 +310,18 @@
if (key == MCTPConnectivityProp)
{
- service = pldm::utils::DBusHandler().getService(objPath.c_str(),
- MCTPInterface);
+ try
+ {
+ service = pldm::utils::DBusHandler().getService(objPath.c_str(),
+ MCTPInterface);
+ }
+ catch (const sdbusplus::exception_t& e)
+ {
+ error(
+ "Error getting service for path '{PATH}', error - {ERROR}",
+ "PATH", objPath, "ERROR", e);
+ return;
+ }
const MctpEndpointProps& epProps =
getMctpEndpointProps(service, objPath);