Handle exceptions from JSON utility APIs

This commit adds proper handling for exceptions thrown by JSON utility
APIs. In some cases, input parameters were being accessed directly from
the JSON object without verifying their presence, leading to potential
exceptions. This commit ensures safer access to JSON fields to prevent
such errors.

Change-Id: I0ae17b3186bf868ea5e0c2e6765dafc76d962f27
Signed-off-by: Rekha Aparna <vrekhaaparna@ibm.com>
diff --git a/vpd-manager/include/error_codes.hpp b/vpd-manager/include/error_codes.hpp
index 648215e..cea46f1 100644
--- a/vpd-manager/include/error_codes.hpp
+++ b/vpd-manager/include/error_codes.hpp
@@ -28,7 +28,8 @@
     INVALID_INPUT_PARAMETER,
     DEVICE_NOT_PRESENT,
     DEVICE_PRESENCE_UNKNOWN,
-    GPIO_LINE_EXCEPTION
+    GPIO_LINE_EXCEPTION,
+    ERROR_PROCESSING_SYSTEM_CMD
 };
 
 const std::unordered_map<int, std::string> errorCodeMap = {
@@ -55,5 +56,7 @@
     {error_code::DEVICE_NOT_PRESENT,
      "Presence pin read successfully but device was absent."},
     {error_code::DEVICE_PRESENCE_UNKNOWN, "Exception on presence line GPIO."},
-    {error_code::GPIO_LINE_EXCEPTION, "There was an exception in GPIO line."}};
+    {error_code::GPIO_LINE_EXCEPTION, "There was an exception in GPIO line."},
+    {error_code::ERROR_PROCESSING_SYSTEM_CMD,
+     "Error while executing system command tag."}};
 } // namespace vpd