Skip to content

Commit

Permalink
fix: retry on all reqwest-related errors
Browse files Browse the repository at this point in the history
Signed-off-by: ljedrz <[email protected]>
  • Loading branch information
ljedrz committed Oct 17, 2022
1 parent 146ebec commit 28d75b8
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions snarkos/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,10 @@ where
use backoff::Error;

if let Ok(err) = err.downcast::<reqwest::Error>() {
if err.is_timeout() {
debug!("Retrying server timeout error");
Error::Transient {
err: err.into(),
retry_after: None,
}
} else {
Error::Permanent(err.into())
debug!("Server error: {err}; retrying...");
Error::Transient {
err: err.into(),
retry_after: None,
}
} else {
Error::Transient {
Expand Down

0 comments on commit 28d75b8

Please sign in to comment.