Error handling for isPowerVsConfiguration API
This commit updates isPowerVsConfiguration 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: I39337b48893476b9dc0d293f414c4766ba283736
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 cbae278..ed6da47 100644
--- a/vpd-manager/oem-handler/ibm_handler.cpp
+++ b/vpd-manager/oem-handler/ibm_handler.cpp
@@ -308,14 +308,21 @@
throw DbusException("Invalid IM value read from Dbus");
}
- if (!vpdSpecificUtility::isPowerVsConfiguration(l_imValue))
+ uint16_t l_errCode = 0;
+ if (!vpdSpecificUtility::isPowerVsConfiguration(l_imValue, l_errCode))
{
// TODO: Should booting be blocked in case of some
// misconfigurations?
+ if (l_errCode)
+ {
+ logging::logMessage(
+ "Failed to check if the system is powerVs Configuration, error : " +
+ commonUtility::getErrCodeMsg(l_errCode));
+ }
+
return;
}
- uint16_t l_errCode = 0;
const nlohmann::json& l_powerVsJsonObj =
jsonUtility::getPowerVsJson(l_imValue, l_errCode);