set error code for getAllPathsToUpdateKeyword API

This commit updates getAllPathsToUpdateKeyword 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: Id28885aee47adccb19ecdc6522a0061778ac0479
Signed-off-by: Rekha Aparna <vrekhaaparna@ibm.com>
diff --git a/vpd-manager/src/parser.cpp b/vpd-manager/src/parser.cpp
index a32d155..e0e173b 100644
--- a/vpd-manager/src/parser.cpp
+++ b/vpd-manager/src/parser.cpp
@@ -126,9 +126,19 @@
             throw std::runtime_error(l_errMsg);
         }
 
+        uint16_t l_errCode = 0;
+
         auto [l_fruPath, l_inventoryObjPath, l_redundantFruPath] =
-            jsonUtility::getAllPathsToUpdateKeyword(m_parsedJson,
-                                                    m_vpdFilePath);
+            jsonUtility::getAllPathsToUpdateKeyword(m_parsedJson, m_vpdFilePath,
+                                                    l_errCode);
+
+        if (l_errCode == error_code::INVALID_INPUT_PARAMETER ||
+            l_errCode == error_code::INVALID_JSON)
+        {
+            throw std::runtime_error(
+                "Failed to get paths to update keyword. Error : " +
+                vpdSpecificUtility::getErrCodeMsg(l_errCode));
+        }
 
         // If inventory D-bus object path is present, update keyword's value on
         // DBus
@@ -205,6 +215,11 @@
             }
         }
 
+        if (l_errCode == error_code::ERROR_GETTING_REDUNDANT_PATH)
+        {
+            logging::logMessage(vpdSpecificUtility::getErrCodeMsg(l_errCode));
+        }
+
         // Update keyword's value on redundant hardware if present
         if (!l_redundantFruPath.empty())
         {