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>