mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
api_client: Add TooManyRequests status code
In order to be on-pair with what's we're using from micro-http, let's also add the proper status code here as well (as it will be used by `ch-remote`). Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
This commit is contained in:
committed by
Bo Chen
parent
d0225fe68f
commit
1968805ba2
@@ -32,6 +32,7 @@ pub enum StatusCode {
|
||||
NoContent,
|
||||
BadRequest,
|
||||
NotFound,
|
||||
TooManyRequests,
|
||||
InternalServerError,
|
||||
NotImplemented,
|
||||
Unknown,
|
||||
@@ -45,6 +46,7 @@ impl StatusCode {
|
||||
204 => StatusCode::NoContent,
|
||||
400 => StatusCode::BadRequest,
|
||||
404 => StatusCode::NotFound,
|
||||
429 => StatusCode::TooManyRequests,
|
||||
500 => StatusCode::InternalServerError,
|
||||
501 => StatusCode::NotImplemented,
|
||||
_ => StatusCode::Unknown,
|
||||
|
||||
Reference in New Issue
Block a user