Error code for getListOfFrusReplaceableAtStandby
This commit updates getListOfFrusReplaceableAtStandby API to set error
code in case of error. This helps caller of API to take action based on
the error code returned from the API.
Change-Id: I54c496f76a0e2079346c8712950ddbce0d855026
Signed-off-by: Rekha Aparna <vrekhaaparna@ibm.com>
diff --git a/vpd-manager/src/worker.cpp b/vpd-manager/src/worker.cpp
index 55e6709..15f5a0e 100644
--- a/vpd-manager/src/worker.cpp
+++ b/vpd-manager/src/worker.cpp
@@ -1935,8 +1935,18 @@
"System config json object is empty, can't process recollection.");
}
+ uint16_t l_errCode = 0;
const auto& l_frusReplaceableAtStandby =
- jsonUtility::getListOfFrusReplaceableAtStandby(m_parsedJson);
+ jsonUtility::getListOfFrusReplaceableAtStandby(m_parsedJson,
+ l_errCode);
+
+ if (l_errCode)
+ {
+ logging::logMessage(
+ "Failed to get list of FRUs replaceable at runtime, error : " +
+ vpdSpecificUtility::getErrCodeMsg(l_errCode));
+ return;
+ }
for (const auto& l_fruInventoryPath : l_frusReplaceableAtStandby)
{