Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

feat: add infura error code to retry detection #1921

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ethers-providers/src/transports/retry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ impl RetryPolicy<ClientError> for HttpRateLimitRetryPolicy {
return true
}

// This is an infura error code for `exceeded project rate limit`
if *code == -32005 {
return true
}

// alternative alchemy error for specific IPs
if *code == -32016 && message.contains("rate limit") {
return true
Expand Down