Add RateLimit information

This commit is contained in:
bitfl0wer 2023-05-14 13:12:02 +02:00
parent 4b4adbe1cc
commit d797a10009
2 changed files with 4 additions and 2 deletions

View File

@ -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.",

View File

@ -115,7 +115,9 @@ impl LimitedRequester {
request,
limit_type,
});
Err(InstanceServerError::RateLimited)
Err(InstanceServerError::RateLimited {
bucket: limit_type.to_string(),
})
}
}