Skip to content

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

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

NorbixError and every subclass (RateLimitError included) take an optional retry_after_seconds keyword and keep it as an attribute (int | None). The sync and async transports read the answer's Retry-After header through the new errors.retry_after_seconds_of (delta seconds, or the seconds until an HTTP date, never below 0; None when absent or unreadable). Additive: every existing argument and attribute keeps its shape; POST is still never retried. README Errors, docs/api/logs.md and the write_logs docstring updated ("wait about a minute" → retry_after_seconds).

Tests: uv run pytest 1165 passed (new: 429 + Retry-After: 37 → 37 and one POST /logs, sync and async; no header → None; 500 → None; HTTP date; retry_after_seconds_of table of 10). ruff check . and mypy src clean.

Expected release: v3.28.0 (feat → minor).

🤖 Generated with Claude Code

Domantas and others added 3 commits October 21, 2026 21:53
NorbixError and every subclass (RateLimitError included) take an optional
retry_after_seconds keyword and keep it as an attribute. The sync and async
transports read the answer's Retry-After header through the new
errors.retry_after_seconds_of (delta seconds, or seconds until an HTTP date,
never below 0; None when absent or unreadable) and pass it to
error_from_body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 500

429 with Retry-After: 37 gives 37 with CM-ERRORS-LOGGING-003 and one POST
/logs (sync and async); no header and a 500 give None; an HTTP date gives the
seconds until it; retry_after_seconds_of 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 8696af9 into main Oct 21, 2026
9 checks passed
@Domantas
Domantas deleted the feat/retry-after branch October 21, 2026 18:55
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.

1 participant