From 6e818852d868eea963dd2b8489ba75b65c56fb1c Mon Sep 17 00:00:00 2001 From: EightFactorial Date: Mon, 30 Jan 2023 16:18:14 -0800 Subject: More packet fixes, tests, handle error (#61) * Fix packet, fix tests, fixedbitsets * Clippy: Nightmare Mode * Fix mistake * simplify impl Display and make thing pub --------- Co-authored-by: mat --- azalea-auth/src/sessionserver.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'azalea-auth/src') diff --git a/azalea-auth/src/sessionserver.rs b/azalea-auth/src/sessionserver.rs index 502ae098..5eefb292 100755 --- a/azalea-auth/src/sessionserver.rs +++ b/azalea-auth/src/sessionserver.rs @@ -24,6 +24,8 @@ pub enum ClientSessionServerError { Unknown(String), #[error("Forbidden operation (expired session?)")] ForbiddenOperation, + #[error("RateLimiter disallowed request")] + RateLimited, #[error("Unexpected response from sessionserver (status code {status_code}): {body}")] UnexpectedResponse { status_code: u16, body: String }, } @@ -95,6 +97,7 @@ pub async fn join( _ => Err(ClientSessionServerError::Unknown(forbidden.error)), } } + StatusCode::TOO_MANY_REQUESTS => Err(ClientSessionServerError::RateLimited), status_code => { // log the headers debug!("Error headers: {:#?}", res.headers()); -- cgit v1.2.3