Handle rejected TOO_MANY_REQUESTS

This commit is contained in:
Thomas Zahner 2025-05-12 11:22:56 +02:00
parent a516461df6
commit d22d1888f1

View file

@ -94,6 +94,11 @@ impl RetryExt for http::Error {
impl RetryExt for ErrorKind {
fn should_retry(&self) -> bool {
match self {
Self::RejectedStatusCode(StatusCode::TOO_MANY_REQUESTS) => return true,
_ => {}
};
// If the error is a `reqwest::Error`, delegate to that
if let Some(r) = self.reqwest_error() {
r.should_retry()