Skip to content

Respect RetryAfterer through error wrapping - #6

Merged
nodivbyzero merged 1 commit into
nodivbyzero:mainfrom
bensynapse:fix-wrapped-retry-after
Oct 4, 2026
Merged

nodivbyzero merged 1 commit into
nodivbyzero:mainfrom
bensynapse:fix-wrapped-retry-after

Conversation

@bensynapse

Copy link
Copy Markdown
Contributor

I run Live Tennis API.

Wrapping a RetryAfterer with fmt.Errorf currently hides its delay and invokes the fallback schedule. Use errors.As to find the requested delay through wrappers and errors.Join.

MaxDelay still caps the wait, and RetryAfterer still takes precedence over WithDelayFunc. An outer RetryAfterer keeps precedence over a nested one.

Eight new cases cover those behaviors and the fallback for errors without RetryAfterer. Five cases fail on unchanged upstream.

On Go 1.27.0, go test ./... -v -race -cover passes with 95.9% coverage. go build ./..., go vet ./... and formatting checks also pass.

@nodivbyzero
nodivbyzero merged commit 0beefc2 into nodivbyzero:main Oct 4, 2026
1 check passed
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.

2 participants