diff --git a/src/errors.rs b/src/errors.rs index e50a931..599b262 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -17,7 +17,7 @@ custom_error! { ReceivedErrorCodeError{error_code:String} = "Received the following error code while requesting from the route: {error_code}", CantGetInfoError{error:String} = "Something seems to be wrong with the instance. Cannot get information about the instance: {error}", InvalidFormBodyError{error_type: String, error:String} = "The server responded with: {error_type}: {error}", - RateLimited = "Ratelimited.", + RateLimited{bucket:String} = "Ratelimited on Bucket {bucket}", MultipartCreationError{error: String} = "Got an error whilst creating the form: {}", TokenExpired = "Token expired, invalid or not found.", NoPermission = "You do not have the permissions needed to perform this action.", diff --git a/src/limit.rs b/src/limit.rs index 7212e7c..cc058b6 100644 --- a/src/limit.rs +++ b/src/limit.rs @@ -115,7 +115,9 @@ impl LimitedRequester { request, limit_type, }); - Err(InstanceServerError::RateLimited) + Err(InstanceServerError::RateLimited { + bucket: limit_type.to_string(), + }) } }