Handle Dbus query exception gracefully
For every Dbus query PLDM uses new_method_call defined in
Sdbusplus. Any error during dbus query it throws an exception.
Modifying code to handle the exception thrown by new_method_call
Change-Id: Ie474e1d230773cb184127b71d333846090ad6c84
Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
diff --git a/host-bmc/dbus_to_host_effecters.cpp b/host-bmc/dbus_to_host_effecters.cpp
index a90a3bd..89a8a95 100644
--- a/host-bmc/dbus_to_host_effecters.cpp
+++ b/host-bmc/dbus_to_host_effecters.cpp
@@ -16,7 +16,6 @@
{
namespace host_effecters
{
-
using InternalFailure =
sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
@@ -178,7 +177,8 @@
catch (const sdbusplus::exception_t& e)
{
std::cerr << "Error in getting current host state. Will still "
- "continue to set the host effecter \n";
+ "continue to set the host effecter - "
+ << e.what() << std::endl;
}
uint8_t newState{};
try