PLDM:Catching exception precisely and printing it
Correcting catch block in PLDM repo to print all
exception precisely so pldm trace can be more
useful to identify defect easily.
Change-Id: If2e86dcb031ddc2e927e7836d7f4359f5b44cdec
Signed-off-by: Kamalkumar Patel <kamalkumar.patel@ibm.com>
diff --git a/libpldmresponder/platform.cpp b/libpldmresponder/platform.cpp
index 57315a4..7587a16 100644
--- a/libpldmresponder/platform.cpp
+++ b/libpldmresponder/platform.cpp
@@ -357,6 +357,7 @@
}
catch (const std::out_of_range& e)
{
+ error("Error in handling platform event msg: {ERROR}", "ERROR", e);
return CmdHandler::ccOnlyResponse(request, PLDM_ERROR_INVALID_DATA);
}
}
@@ -432,7 +433,7 @@
std::tie(entityInfo, compositeSensorStates) =
hostPDRHandler->lookupSensorInfo(sensorEntry);
}
- catch (const std::out_of_range& e)
+ catch (const std::out_of_range&)
{
// If there is no mapping for tid, sensorId combination, try
// PLDM_TID_RESERVED, sensorId for terminus that is yet to
@@ -444,7 +445,7 @@
hostPDRHandler->lookupSensorInfo(sensorEntry);
}
// If there is no mapping for events return PLDM_SUCCESS
- catch (const std::out_of_range& e)
+ catch (const std::out_of_range&)
{
return PLDM_SUCCESS;
}