API to get error info based on the exception

This commit implements an event logger API to extract the error info
based on the exception type.

Change-Id: I132306a6d3127253435e53f61328843fa8f1be24
Signed-off-by: Anupama B R <anupama.b.r1@ibm.com>
diff --git a/vpd-manager/include/event_logger.hpp b/vpd-manager/include/event_logger.hpp
index 0080be6..7c466ce 100644
--- a/vpd-manager/include/event_logger.hpp
+++ b/vpd-manager/include/event_logger.hpp
@@ -160,6 +160,17 @@
         const std::optional<std::string> i_procedure);
 
   private:
+    /**
+     * @brief API to get error info based on the exception.
+     *
+     * @param[in] i_exception - Exception object.
+     *
+     * @return - Valid ExceptionDataMap on success, otherwise map having default
+     * value.
+     */
+    static types::ExceptionDataMap getExceptionData(
+        const std::exception& i_exception);
+
     static const std::unordered_map<types::SeverityType, std::string>
         m_severityMap;
     static const std::unordered_map<types::ErrorType, std::string>
diff --git a/vpd-manager/include/types.hpp b/vpd-manager/include/types.hpp
index 37affa7..7dacb26 100644
--- a/vpd-manager/include/types.hpp
+++ b/vpd-manager/include/types.hpp
@@ -190,5 +190,9 @@
 using InventoryCalloutData = std::tuple<std::string, CalloutPriority>;
 using DeviceCalloutData = std::tuple<std::string, std::string>;
 using I2cBusCalloutData = std::tuple<std::string, std::string, std::string>;
+
+using ExceptionInfoVariant = std::variant<std::monostate, ErrorType, std::string>;
+/* Error info map of format <Error format, Value> */
+using ExceptionDataMap = std::map<std::string, ExceptionInfoVariant>;
 } // namespace types
 } // namespace vpd