From d22d1888f1ca6ee1a49bf364e46b34057c4b63c1 Mon Sep 17 00:00:00 2001 From: Thomas Zahner Date: Mon, 12 May 2025 11:22:56 +0200 Subject: [PATCH] Handle rejected TOO_MANY_REQUESTS --- lychee-lib/src/retry.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lychee-lib/src/retry.rs b/lychee-lib/src/retry.rs index f6333c1..b5341d8 100644 --- a/lychee-lib/src/retry.rs +++ b/lychee-lib/src/retry.rs @@ -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()