Repository navigation
docs(extract): explain the 429 domain_rejection_limit answer from prepare_domain() - #78
Merged
Merged
Conversation
…pare_domain() prepare_domain() can now be refused with a 429 domain_rejection_limit when a domain's preparations failed verification as many times as the monthly limit allows. PreparedDomainError already carries its code, detail and members, and the client never retries it; this documents it next to out_of_allowance and adds a test that pins that behaviour.
jonathan-zenrows
marked this pull request as ready for review
November 23, 2026 08:39
gonzalo-zenrows
approved these changes
Nov 23, 2026
gonzalo-zenrows
left a comment
Contributor
There was a problem hiding this comment.
I verified that prepare_domain() raises PreparedDomainError with the server’s code, detail, and rejection fields in err.problem. The client sent one request with retries enabled.
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.
What changes for a caller
The API can now refuse
prepare_domain()with a429whose problemcodeisdomain_rejection_limit. It means this domain's preparations failed verification as many times as the monthly limit allows. Don't submit that domain again this month. You can still prepare other domains, and the refused submission cost nothing. The problem body also carriesdomain,rejected,limitandmonth.The client already handles it.
PreparedDomainErrorcarries the code, the detail and the wholeproblembody, and the client sends the call once even with retries turned on. The existing429out_of_allowancekeeps its own code. Behaviour does not change, so this is a docs change.Changes
PreparedDomainErrordoc comment, theprepare_domain()docstring and the prepare section ofREADME.mdlistdomain_rejection_limitnext toout_of_allowance.README.mdexplains how the two429codes differ.429domain_rejection_limitbody. It checks the code, the exact detail and thedomain,rejected,limitandmonthmembers, and that the client sent one request with retries configured.Tests
make test(pytest): 445 passed, 12 subtests passed.make check(ty, ruff check, ruff format --check): all green.Live proof
The proof script runs the wheel that
uv buildproduced, installed in an isolated environment, against a local HTTP stub throughbase_url. It creates the client withretries=3. The stub answers the prepare POST with the429problem body.The stub answers
domain_rejection_limit:Negative case: the same stub answers
out_of_allowance, which still comes back as its own code with its own members:Each stub log shows one POST, so the client retried neither answer.