Skip to content

Commit

Permalink
accepting README.md suggestion
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Uber <[email protected]>
  • Loading branch information
gavriel-hc and ryanuber authored Apr 13, 2022
1 parent 5081362 commit c9eb34c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ call would block and retry with exponential backoff.

## Retrying cases that fail after a seeming success

It's possible for a request to succeed, but then for later processing to fail, and sometimes this requires retrying the full request. E.g. a GET that returns a lot of data may "succeed" but the connection may drop while reading all of the data.
It's possible for a request to succeed in the sense that the expected response headers are received, but then to encounter network-level errors while reading the response body. In go-retryablehttp's most basic usage, this error would not be retryable, due to the out-of-band handling of the response body. In some cases it may be desirable to handle the response body as part of the retryable operation.

In such a case, you can use `DoWithResponseHandler` (or `GetWithResponseHandler`) rather than `Do` (or `Get`). A toy example (which will retry the full request and succeed on the second attempt) is shown below:

Expand Down

0 comments on commit c9eb34c

Please sign in to comment.