Error handling for resetDataUnderPIM API

This commit updates resetDataUnderPIM 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: I71427b473d3094d0b2ea357cdde4d6c4d2627d2b
Signed-off-by: Rekha Aparna <vrekhaaparna@ibm.com>
diff --git a/wait-vpd-parser/src/prime_inventory.cpp b/wait-vpd-parser/src/prime_inventory.cpp
index 137231b..67a6671 100644
--- a/wait-vpd-parser/src/prime_inventory.cpp
+++ b/wait-vpd-parser/src/prime_inventory.cpp
@@ -174,8 +174,18 @@
     if (isPresentPropertyHandlingRequired(i_fruJsonObj))
     {
         // Clear data under PIM if already exists.
+        uint16_t l_errCode = 0;
         vpd::vpdSpecificUtility::resetDataUnderPIM(
-            std::string(i_fruJsonObj["inventoryPath"]), l_interfaces);
+            std::string(i_fruJsonObj["inventoryPath"]), l_interfaces,
+            l_errCode);
+
+        if (l_errCode)
+        {
+            m_logger->logMessage(
+                "Failed to reset data under PIM for path [" +
+                std::string(i_fruJsonObj["inventoryPath"]) +
+                "], error : " + vpd::commonUtility::getErrCodeMsg(l_errCode));
+        }
     }
 
     // Add extra interfaces mentioned in the Json config file