Error handling for getkwVal API
This commit updates getKwVal APIs to set error code in case of error.
This helps the caller of API to take action based on the error code
returned from the API.
Change-Id: I884dae49ebc56c57cb41f880dfc796ab53b47d16
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 af7620c..0ac08aa 100644
--- a/vpd-manager/include/error_codes.hpp
+++ b/vpd-manager/include/error_codes.hpp
@@ -34,7 +34,8 @@
STANDARD_EXCEPTION,
// VPD specific errors
- UNSUPPORTED_VPD_TYPE
+ UNSUPPORTED_VPD_TYPE,
+ KEYWORD_NOT_FOUND
};
const std::unordered_map<int, std::string> errorCodeMap = {
@@ -64,6 +65,7 @@
{error_code::GPIO_LINE_EXCEPTION, "There was an exception in GPIO line."},
{error_code::ERROR_PROCESSING_SYSTEM_CMD,
"Error while executing system command tag."},
+ {error_code::KEYWORD_NOT_FOUND, "Keyword not found"},
{error_code::UNSUPPORTED_VPD_TYPE, "This VPD type is not supported"},
{error_code::STANDARD_EXCEPTION, "Standard Exception thrown"},
{error_code::FILE_SYSTEM_ERROR, "File system error."}};