Add RateLimit information
This commit is contained in:
parent
4b4adbe1cc
commit
d797a10009
|
@ -17,7 +17,7 @@ custom_error! {
|
||||||
ReceivedErrorCodeError{error_code:String} = "Received the following error code while requesting from the route: {error_code}",
|
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}",
|
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}",
|
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: {}",
|
MultipartCreationError{error: String} = "Got an error whilst creating the form: {}",
|
||||||
TokenExpired = "Token expired, invalid or not found.",
|
TokenExpired = "Token expired, invalid or not found.",
|
||||||
NoPermission = "You do not have the permissions needed to perform this action.",
|
NoPermission = "You do not have the permissions needed to perform this action.",
|
||||||
|
|
|
@ -115,7 +115,9 @@ impl LimitedRequester {
|
||||||
request,
|
request,
|
||||||
limit_type,
|
limit_type,
|
||||||
});
|
});
|
||||||
Err(InstanceServerError::RateLimited)
|
Err(InstanceServerError::RateLimited {
|
||||||
|
bucket: limit_type.to_string(),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue