Error code handling in processing specific tags
The change implements error code to handle failure while processing some
of the JSON tags.
Going forward, error code will be used by the caller to identify the
type of failure that occurred while processing the tags and based
on that appropriate action will be taken.
Change-Id: I95783836d8829f0d50459a26da37a2e4e21638f5
Signed-off-by: Sunny Srivastava <sunnsr25@in.ibm.com>
diff --git a/vpd-manager/include/error_codes.hpp b/vpd-manager/include/error_codes.hpp
index ad436c4..204b96a 100644
--- a/vpd-manager/include/error_codes.hpp
+++ b/vpd-manager/include/error_codes.hpp
@@ -18,9 +18,13 @@
static constexpr auto MISSING_ACTION_TAG = 2003;
static constexpr auto FRU_PATH_NOT_FOUND = 2004;
static constexpr auto JSON_PARSE_ERROR = 2005;
+static constexpr auto JSON_MISSING_GPIO_INFO = 2006;
// Generic errors.
static constexpr auto INVALID_INPUT_PARAMETER = 3001;
+static constexpr auto DEVICE_NOT_PRESENT = 2006;
+static constexpr auto DEVICE_PRESENCE_UNKNOWN = 2007;
+static constexpr auto GPIO_LINE_EXCEPTION = 2008;
const std::unordered_map<int, std::string> errorCodeMap = {
{FILE_NOT_FOUND, "File does not exist."},
@@ -33,6 +37,11 @@
{FRU_PATH_NOT_FOUND, "The FRU path is not found in the JSON."},
{JSON_PARSE_ERROR, "Error while parsing JSON file."},
{INVALID_INPUT_PARAMETER,
- "Either one of the input parameter is invalid or empty."}};
+ "Either one of the input parameter is invalid or empty."},
+ {JSON_MISSING_GPIO_INFO, "JSON missing required GPIO info."},
+ {DEVICE_NOT_PRESENT,
+ "Presence pin read successfully but device was absent."},
+ {DEVICE_PRESENCE_UNKNOWN, "Exception on presence line GPIO."},
+ {GPIO_LINE_EXCEPTION, "There was an exception in GPIO line."}};
} // namespace error_code
} // namespace vpd