Error code for findCcinInVpd API

This commit updates findCcinInVpd 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: I9ce9ae7b9bf9b80766a2dc44836ecde51ce28255
Signed-off-by: Rekha Aparna <vrekhaaparna@ibm.com>
diff --git a/vpd-manager/src/worker.cpp b/vpd-manager/src/worker.cpp
index 520fc20..48d4dc8 100644
--- a/vpd-manager/src/worker.cpp
+++ b/vpd-manager/src/worker.cpp
@@ -1252,6 +1252,8 @@
 
     // Check if post action tag is to be triggered in the flow of collection
     // based on some CCIN value?
+    uint16_t l_errCode = 0;
+
     if (m_parsedJson["frus"][i_vpdFruPath]
             .at(0)["postAction"][i_flagToProcess]
             .contains("ccin"))
@@ -1267,15 +1269,23 @@
         if (!vpdSpecificUtility::findCcinInVpd(
                 m_parsedJson["frus"][i_vpdFruPath].at(
                     0)["postAction"]["collection"],
-                i_parsedVpd.value()))
+                i_parsedVpd.value(), l_errCode))
         {
+            if (l_errCode)
+            {
+                // ToDo - Check if PEL is required in case of RECORD_NOT_FOUND
+                // and KEYWORD_NOT_FOUND error codes.
+                logging::logMessage("Failed to find CCIN in VPD, error : " +
+                                    commonUtility::getErrCodeMsg(l_errCode));
+            }
+
             // If CCIN is not found, implies post action processing is not
             // required for this FRU. Let the flow continue.
             return true;
         }
     }
 
-    uint16_t l_errCode = 0;
+    l_errCode = 0;
     if (!jsonUtility::executeBaseAction(m_parsedJson, "postAction",
                                         i_vpdFruPath, i_flagToProcess,
                                         l_errCode))