diff options
author | metamuffin <metamuffin@disroot.org> | 2025-03-30 20:57:55 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-03-30 20:57:55 +0200 |
commit | 939091713a21ac6e508ef365f8ee9f258f6d50f8 (patch) | |
tree | db2872a07ab5087389a395e351a5a5ea5bd2267f /src/error.rs | |
parent | 6c40b37bfa89e7b6839d7bc2f730be53e637fdd8 (diff) | |
download | gnix-939091713a21ac6e508ef365f8ee9f258f6d50f8.tar gnix-939091713a21ac6e508ef365f8ee9f258f6d50f8.tar.bz2 gnix-939091713a21ac6e508ef365f8ee9f258f6d50f8.tar.zst |
ratelimit module
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index 1964c0d..cccfd78 100644 --- a/src/error.rs +++ b/src/error.rs @@ -55,6 +55,8 @@ pub enum ServiceError { InvalidHeader, #[error("invalid uri")] InvalidUri, + #[error("too many concurrent users, please retry later")] + TooManyIdentities, #[error("impossible error")] Other, } @@ -88,6 +90,7 @@ impl ServiceError { ServiceError::ParseIntError(_) => StatusCode::BAD_REQUEST, ServiceError::InvalidHeader => StatusCode::BAD_REQUEST, ServiceError::InvalidUri => StatusCode::BAD_REQUEST, + ServiceError::TooManyIdentities => StatusCode::TOO_MANY_REQUESTS, ServiceError::Other => StatusCode::INTERNAL_SERVER_ERROR, } } |