Repository navigation
InsufficientBalanceError for 403 INSUFFICIENT_BALANCE; free plan 401 docs #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a3bf974
96874ba
2ab92bb
0114ead
2926654
343be0a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -370,7 +370,7 @@ except ValidationError as err: | |
| ... | ||
| ``` | ||
|
|
||
| `AuthenticationError`, `PlanAccessError`, `NotFoundError`, `ServerError`, and `APIConnectionError` cover the rest. Transient failures are retried automatically (3 attempts by default). | ||
| `AuthenticationError`, `PlanAccessError`, `NotFoundError`, `ServerError`, and `APIConnectionError` cover the rest. A request the account's remaining balance cannot cover raises `InsufficientBalanceError` (a `PlanAccessError`), whose `max_affordable_records` is the largest size that would fit, counted in the request's own unit (the message names it: records, contacts, domains, rows, queries or personas). Transient failures are retried automatically (3 attempts by default). | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Qualify the advice here and in Prompt To Fix With AIThis is a comment left during a code review.
Path: README.md
Line: 373
Comment:
**Retry advice misses zero**
`max_affordable_records` is not always a size that fits. The new exception documentation says it can be `0` when even the request fee exceeds the balance. Single-company and single-email requests also cannot be made smaller. A caller following this advice could retry with zero records and get another error.
Qualify the advice here and in `CHANGELOG.md`: retry smaller only when the request supports it and the value is positive; otherwise top up.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly. |
||
|
|
||
| ```python | ||
| import pydantic | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The claim “No SDK code change” contradicts this PR.
_extract_messagegains the object-detailbranch that makesAuthenticationErroruse the server'smessage; older versions fall back to the JSON body. Remove that claim so readers know the readable message requires the updated SDK.Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!