Skip to content

Commit

Permalink
Add new status code. (#828)
Browse files Browse the repository at this point in the history
Change-Id: I0e7fd00bba6e21770d4acf6965440463ccba5927

Co-authored-by: Prince Sunny <prince.sunny@microsoft.com>
  • Loading branch information
mint570 and prsunny authored Mar 19, 2024
1 parent 476a65c commit e7917ac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion common/status_code_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ enum class StatusCode
SWSS_RC_IN_USE,
SWSS_RC_INTERNAL,
SWSS_RC_UNIMPLEMENTED,
SWSS_RC_NOT_EXECUTED,
SWSS_RC_FAILED_PRECONDITION,
SWSS_RC_UNKNOWN,
};

Expand All @@ -36,6 +38,8 @@ static const std::map<StatusCode, std::string> statusCodeMapping = {
{StatusCode::SWSS_RC_IN_USE, "SWSS_RC_IN_USE"},
{StatusCode::SWSS_RC_INTERNAL, "SWSS_RC_INTERNAL"},
{StatusCode::SWSS_RC_UNIMPLEMENTED, "SWSS_RC_UNIMPLEMENTED"},
{StatusCode::SWSS_RC_NOT_EXECUTED, "SWSS_RC_NOT_EXECUTED"},
{StatusCode::SWSS_RC_FAILED_PRECONDITION, "SWSS_RC_FAILED_PRECONDITION"},
{StatusCode::SWSS_RC_UNKNOWN, "SWSS_RC_UNKNOWN"},
};

Expand All @@ -52,6 +56,8 @@ static const std::map<std::string, StatusCode> StatusCodeLookup = {
{"SWSS_RC_IN_USE", StatusCode::SWSS_RC_IN_USE},
{"SWSS_RC_INTERNAL", StatusCode::SWSS_RC_INTERNAL},
{"SWSS_RC_UNIMPLEMENTED", StatusCode::SWSS_RC_UNIMPLEMENTED},
{"SWSS_RC_NOT_EXECUTED", StatusCode::SWSS_RC_NOT_EXECUTED},
{"SWSS_RC_FAILED_PRECONDITION", StatusCode::SWSS_RC_FAILED_PRECONDITION},
{"SWSS_RC_UNKNOWN", StatusCode::SWSS_RC_UNKNOWN},
};

Expand All @@ -73,4 +79,4 @@ static inline StatusCode strToStatusCode(const std::string &status)
return StatusCodeLookup.at(status);
}

} // namespace swss
} // namespace swss

0 comments on commit e7917ac

Please sign in to comment.