In these parts of the code we returning before adding the latest error to the errors: Vec<_>. This causes this code to return AllAttemptsErrored([]) which is a bit frustrating.
|
let failed_attempts = errors.len() + 1; |
|
|
|
if retries_exhausted(failed_attempts, $self.config.retry()) { |
|
warn!("call '{}' failed after {} attempts", stringify!($name), failed_attempts); |
|
return Err(Error::AllAttemptsErrored(errors)); |
|
} |
|
|
|
warn!("call '{}' failed with {}, retry: {}/{}", stringify!($name), e, failed_attempts, $self.config.retry()); |
|
|
|
errors.push(e); |
|
let failed_attempts = errors.len() + 1; |
|
|
|
if retries_exhausted(failed_attempts, $self.config.retry()) { |
|
warn!("re-creating client failed after {} attempts", failed_attempts); |
|
return Err(Error::AllAttemptsErrored(errors)); |
|
} |
|
|
|
warn!("re-creating client failed with {}, retry: {}/{}", e, failed_attempts, $self.config.retry()); |
|
|
|
errors.push(e); |
In these parts of the code we returning before adding the latest error to the
errors: Vec<_>. This causes this code to returnAllAttemptsErrored([])which is a bit frustrating.rust-electrum-client/src/client.rs
Lines 56 to 65 in 761796c
rust-electrum-client/src/client.rs
Lines 80 to 89 in 761796c