Skip to content

feat(errors): expose Retry-After seconds on rate-limit errors - #49

Merged
Domantas merged 3 commits into
mainfrom
feat/retry-after
Oct 21, 2026
Merged

Domantas merged 3 commits into
mainfrom
feat/retry-after

Conversation

@Domantas

Copy link
Copy Markdown
Contributor

errors.Error gains RetryAfterSeconds *int and *errors.RateLimitError gains RetryAfterSeconds() *int. The transport builds failures with the new errors.FromResponse(body, status, header), which reads the Retry-After header (delta seconds, or the seconds until an HTTP date, never below 0; nil when absent or unreadable). Additive: FromBody and every existing type keep their shape; POST is still never retried. README errors section, docs/hub/logs.md and the WriteLogs doc 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; RetryAfterSecondsOf table). go vet ./norbix/... clean, gofmt -l . empty.

Expected release: v2.30.0 (feat → minor).

🤖 Generated with Claude Code

Domantas and others added 3 commits October 21, 2026 21:50
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>
@Domantas
Domantas merged commit 591227f into main Oct 21, 2026
6 checks passed
@Domantas
Domantas deleted the feat/retry-after branch October 21, 2026 18:51
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.31.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant