hashicorp / hashicorp/go-retryablehttp
Return the body alongside the status in the `baseRetryPolicy` in case of error
Open
- Dominant language
- Go
- Stars
- 2.3k
- Forks
- 298
- PR merge metrics
- No merged PRs in 30d
Description
Presently, when the following case is true inside the `baseRetryPolicy`:
```
if resp.StatusCode == 0 || (resp.StatusCode >= 500 && resp.StatusCode != http.StatusNotImplemented) {
```
the only things returned are the `status` and the `statusCode`, however, in some cases, the server returns more information regarding the error within the response's body.
Adding the `response body` to the error returned by the `baseRetryPolicy` would be helpful for logging and debugging purposes.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.