Skip to content

fix: preserve final response in PassthroughErrorHandler#288

Open
happysnaker wants to merge 1 commit into
hashicorp:mainfrom
happysnaker:fix-passthrough-error-handler-response
Open

fix: preserve final response in PassthroughErrorHandler#288
happysnaker wants to merge 1 commit into
hashicorp:mainfrom
happysnaker:fix-passthrough-error-handler-response

Conversation

@happysnaker

Copy link
Copy Markdown

Description

  • make PassthroughErrorHandler return the terminal *http.Response without a competing error when a response exists
  • keep http.Client / StandardClient() callers from silently discarding the final HTTP response on retry exhaustion
  • add focused tests for the error handler itself and the StandardClient / RoundTripper path

Related Issue

Closes #156

How Has This Been Tested?

  • added unit coverage for PassthroughErrorHandler
  • added an integration-style test covering StandardClient() preserving the final 500 response

@happysnaker happysnaker requested a review from a team as a code owner June 30, 2026 12:37
@hashicorp-cla-app

hashicorp-cla-app Bot commented Jun 30, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@hashicorp-cla-app

Copy link
Copy Markdown

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


lushirong.77 seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA.
If you have already a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

@happysnaker

Copy link
Copy Markdown
Author

This should now be ready for review on my side. The current status check blocker is the HashiCorp CLA gate; I have already signed the CLA before, but the new PR still shows license/cla as pending right after creation, so I am waiting for that bot/status to refresh.

Change summary:

  • PassthroughErrorHandler now returns the terminal *http.Response without a competing error when a response exists
  • added a focused unit test for the handler
  • added a StandardClient() / RoundTripper test showing the final 500 response body remains available to callers

If you want, I can also add a short README/doc note clarifying this default behavior for PassthroughErrorHandler.

@happysnaker happysnaker force-pushed the fix-passthrough-error-handler-response branch from b167ec5 to 4f6af93 Compare June 30, 2026 12:55
@happysnaker

Copy link
Copy Markdown
Author

Follow-up: I force-pushed the branch so the commit is now authored with my GitHub-linked noreply address (73147033+happysnaker@users.noreply.github.com) instead of the previous unlinked work email.

If the CLA check does not refresh automatically from that updated commit metadata, please let me know and I can re-run whatever recheck flow you prefer.

@happysnaker

Copy link
Copy Markdown
Author

Quick follow-up on the remaining blocker: the commits on these branches now use my GitHub-linked noreply address, and I've already completed the HashiCorp CLA flow, but license/cla is still stuck in PENDING on #288 / #289 / #290.

If there is a maintainer-side recheck I should trigger, or a preferred support path for a stuck CLA status, I'd appreciate a pointer. Thanks!

@happysnaker

Copy link
Copy Markdown
Author

Update: I re-ran the HashiCorp CLA flow successfully and the CLA backend now reports my signature as active for this repo/PR context. If the GitHub license/cla status remains stuck in PENDING, it looks like a sync/recheck issue rather than an unsigned CLA on my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PassthroughErrorHandler shouldn't pass an error if response is non-nil

1 participant