hashicorp / hashicorp/go-retryablehttp

ResponseLogHook is not called if error is nil

Open
#87 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.3k
Forks
298
PR merge metrics
No merged PRs in 30d

Description

From what I understood you are calling log hook only if response is present, which makes sense. However hooks in my perspective is something called regardless of whether response is successful or not. For sure I can use `checkRetry` feature to get notified when response is returned, but maybe it would be possible to add something like OnErrorLogHook to ensure `http.Do` is fully wrapped?

here is a piece of code I am referring to:
https://github.com/hashicorp/go-retryablehttp/blob/master/client.go#L523

Let me know if this makes sense, I can add go with a PR

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.