Error code for getCcinFromDbus API
This commit updates getCcinFromDbus API to set error code in case of
error. This helps the caller of API to take action based on the error
code returned from the API.
Change-Id: I0ff936ca3486c09921ab0d8deb61814d07ce70d3
Signed-off-by: Rekha Aparna <vrekhaaparna@ibm.com>
diff --git a/vpd-manager/oem-handler/ibm_handler.cpp b/vpd-manager/oem-handler/ibm_handler.cpp
index 99acdc7..766f54c 100644
--- a/vpd-manager/oem-handler/ibm_handler.cpp
+++ b/vpd-manager/oem-handler/ibm_handler.cpp
@@ -218,12 +218,21 @@
// check if the FRU needs CCIN check before updating PN.
if (l_recJson.contains("CCIN"))
{
+ l_errCode = 0;
+
const auto& l_ccinFromDbus =
- vpdSpecificUtility::getCcinFromDbus(l_inventoryPath);
+ vpdSpecificUtility::getCcinFromDbus(l_inventoryPath, l_errCode);
// Not an ideal situation as CCIN can't be empty.
if (l_ccinFromDbus.empty())
{
+ if (l_errCode)
+ {
+ m_logger->logMessage(
+ "Failed to get CCIN value from DBus, error : " +
+ commonUtility::getErrCodeMsg(l_errCode));
+ }
+
o_failedPathList.push_back(l_fruPath);
continue;
}