Set error code for isFruReplaceableAtStandby API

This commit updates isFruReplaceableAtStandby 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: I032ae984fefd9d1fc419c88a399db527f028f4fa
Signed-off-by: Rekha Aparna <vrekhaaparna@ibm.com>
diff --git a/vpd-manager/src/worker.cpp b/vpd-manager/src/worker.cpp
index a80957d..ca9df5a 100644
--- a/vpd-manager/src/worker.cpp
+++ b/vpd-manager/src/worker.cpp
@@ -1928,8 +1928,20 @@
         }
         else if (dbusUtility::isBMCReady())
         {
-            if (!jsonUtility::isFruReplaceableAtStandby(m_parsedJson,
-                                                        l_fruPath) &&
+            uint16_t l_errCode = 0;
+            bool isFruReplaceableAtStandby =
+                jsonUtility::isFruReplaceableAtStandby(m_parsedJson, l_fruPath,
+                                                       l_errCode);
+
+            if (l_errCode)
+            {
+                logging::logMessage(
+                    "Error while checking if FRU is replaceable at standby for FRU [" +
+                    std::string(i_dbusObjPath) + "], error : " +
+                    vpdSpecificUtility::getErrCodeMsg(l_errCode));
+            }
+
+            if (!isFruReplaceableAtStandby &&
                 (!jsonUtility::isFruReplaceableAtRuntime(m_parsedJson,
                                                          l_fruPath)))
             {