Skip to content

Commit 1968805

Browse files
fidenciolikebreath
authored andcommitted
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>
1 parent d0225fe commit 1968805

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

api_client/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ pub enum StatusCode {
3232
NoContent,
3333
BadRequest,
3434
NotFound,
35+
TooManyRequests,
3536
InternalServerError,
3637
NotImplemented,
3738
Unknown,
@@ -45,6 +46,7 @@ impl StatusCode {
4546
204 => StatusCode::NoContent,
4647
400 => StatusCode::BadRequest,
4748
404 => StatusCode::NotFound,
49+
429 => StatusCode::TooManyRequests,
4850
500 => StatusCode::InternalServerError,
4951
501 => StatusCode::NotImplemented,
5052
_ => StatusCode::Unknown,

0 commit comments

Comments
 (0)