Error code handling in processing specific tags

The change implements error code to handle failure while processing some
of the JSON tags.
Going forward, error code will be used by the caller to identify the
type of failure that occurred while processing the tags  and based
on that appropriate action will be taken.

Change-Id: I95783836d8829f0d50459a26da37a2e4e21638f5
Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
diff --git a/vpd-manager/src/gpio_monitor.cpp b/vpd-manager/src/gpio_monitor.cpp
index d758c90..b155fac 100644
--- a/vpd-manager/src/gpio_monitor.cpp
+++ b/vpd-manager/src/gpio_monitor.cpp
@@ -81,9 +81,17 @@
         return;
     }
 
+    uint16_t l_errCode = 0;
     bool l_currentPresencePinValue = jsonUtility::processGpioPresenceTag(
         m_worker->getSysCfgJsonObj(), m_fruPath, "pollingRequired",
-        "hotPlugging");
+        "hotPlugging", l_errCode);
+
+    if (l_errCode && l_errCode != error_code::DEVICE_NOT_PRESENT)
+    {
+        logging::logMessage("processGpioPresenceTag returned false for FRU [" +
+                            m_fruPath + "] Due to error. Reason: " +
+                            vpdSpecificUtility::getErrCodeMsg(l_errCode));
+    }
 
     if (m_prevPresencePinValue != l_currentPresencePinValue)
     {
@@ -101,9 +109,17 @@
 void GpioEventHandler::setEventHandlerForGpioPresence(
     const std::shared_ptr<boost::asio::io_context>& i_ioContext)
 {
+    uint16_t l_errCode = 0;
     m_prevPresencePinValue = jsonUtility::processGpioPresenceTag(
         m_worker->getSysCfgJsonObj(), m_fruPath, "pollingRequired",
-        "hotPlugging");
+        "hotPlugging", l_errCode);
+
+    if (l_errCode && l_errCode != error_code::DEVICE_NOT_PRESENT)
+    {
+        logging::logMessage("processGpioPresenceTag returned false for FRU [" +
+                            m_fruPath + "] Due to error. Reason: " +
+                            vpdSpecificUtility::getErrCodeMsg(l_errCode));
+    }
 
     static std::vector<std::shared_ptr<boost::asio::steady_timer>> l_timers;