Skip to content

Routinely returns AllAttemptsErrored([]) on failed requests #186

@binarybaron

Description

@binarybaron

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions