docs: point event_hooks at a caller-built httpx2 client - #149
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
docs/middleware.mdrecommendsevent_hooks"on the wrappedhttpx2_client" for low-level transforms. Since 0.18.0 (#148), httpware forwards every httpx2 client option exceptevent_hooks, which it refuses. The guide didn't say why, so the two read as contradictory.Change
The bullet now says to put hooks on an httpx2 client you build and pass as
httpx2_client=, and explains the refusal. Anhttpx2.HTTPStatusErrorraised in a hook (for example byraise_for_status()) reaches the chain as a plainTransportError, not aStatusError.AsyncRetryonly retriesStatusError/NetworkError/TimeoutError, and the circuit breaker only counts those, so the error is neither retried nor counted.Verification
Checked by hand: a hook calling
raise_for_status()on a 503, behindAsyncRetry, raisesTransportErrorafter one attempt.mkdocs build --strictpasses.