Repository navigation
feat(errors): expose Retry-After seconds on rate-limit errors - #60
Merged
Merged
Conversation
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>
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.
NorbixErrorand every subclass (RateLimitErrorincluded) take an optionalretry_after_secondskeyword and keep it as an attribute (int | None). The sync and async transports read the answer'sRetry-Afterheader through the newerrors.retry_after_seconds_of(delta seconds, or the seconds until an HTTP date, never below 0;Nonewhen absent or unreadable). Additive: every existing argument and attribute keeps its shape; POST is still never retried. README Errors,docs/api/logs.mdand thewrite_logsdocstring updated ("wait about a minute" →retry_after_seconds).Tests:
uv run pytest1165 passed (new: 429 +Retry-After: 37→ 37 and one POST /logs, sync and async; no header → None; 500 → None; HTTP date;retry_after_seconds_oftable of 10).ruff check .andmypy srcclean.Expected release: v3.28.0 (feat → minor).
🤖 Generated with Claude Code