Repository navigation
feat(errors): expose Retry-After seconds on rate-limit errors - #49
Merged
Merged
Conversation
errors.Error gains RetryAfterSeconds (*int) and RateLimitError gains RetryAfterSeconds(). The transport now builds errors with the new errors.FromResponse(body, status, header), which reads Retry-After (delta seconds, or seconds until an HTTP date, never below 0; nil when absent or unreadable). FromBody is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
429 with Retry-After: 37 gives 37 with CM-ERRORS-LOGGING-003 and one POST /logs; an HTTP date gives the seconds until it; no header, an unreadable one and a 500 give nil. RetryAfterSecondsOf table test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🎉 This PR is included in version 2.31.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
errors.ErrorgainsRetryAfterSeconds *intand*errors.RateLimitErrorgainsRetryAfterSeconds() *int. The transport builds failures with the newerrors.FromResponse(body, status, header), which reads theRetry-Afterheader (delta seconds, or the seconds until an HTTP date, never below 0; nil when absent or unreadable). Additive:FromBodyand every existing type keep their shape; POST is still never retried. README errors section,docs/hub/logs.mdand theWriteLogsdoc comment updated ("wait up to a minute" →RetryAfterSeconds()).Tests:
go test ./norbix/...green (172 tests pass, 0 fail; 5 new: 429 +Retry-After: 37→ 37 and one POST /logs; HTTP date; no / unreadable / negative header → nil; 500 → nil;RetryAfterSecondsOftable).go vet ./norbix/...clean,gofmt -l .empty.Expected release: v2.30.0 (feat → minor).
🤖 Generated with Claude Code