Skip to content

Handle the 429 cooldown in the quickstart examples - #6

Merged
senid231 merged 1 commit into
didww:mainfrom
senid231:examples-handle-cooldown
Oct 1, 2026
Merged

senid231 merged 1 commit into
didww:mainfrom
senid231:examples-handle-cooldown

Conversation

@senid231

@senid231 senid231 commented Oct 1, 2026

Copy link
Copy Markdown
Member

Summary

Both quickstart examples called start_verification with no handling for
DidwwRateLimitedError, so hitting the destination cooldown (429,
destination_in_cooldown) crashed the script with an uncaught exception
instead of showing the documented recovery path.

Changes

Wrap the start_verification call in try/except DidwwRateLimitedError in
both examples/quickstart_sync.py and examples/quickstart_async.py, print
retry_after (falling back to a generic message when it is None), and
exit with status 1 — matching the existing DidwwValidationError handling
already below it in each file. The other examples (auth_modes.py,
polling.py, the callback examples) don't call start_verification, so
they needed no change.

Verification

ruff check ., ruff format --check ., mypy, pyright and pytest all
pass locally.

Both quickstarts crashed with an uncaught DidwwRateLimitedError when
start_verification hit the destination cooldown. Catch it and print
retry_after, matching the existing wrong-code handling below it.

Co-Authored-By: Clanker
@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 35ad2d1e-4974-4e0d-9e4b-3d92039887ab

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

Copy link
Copy Markdown

@senid231 senid231 self-assigned this Oct 1, 2026
@senid231
senid231 requested review from blurvene and a balanced review from Copilot October 1, 2026 11:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

Both examples correctly handle the documented 429 cooldown path without affecting successful execution.

Review effort: Balanced
Findings: None

What changed in this PR

Adds graceful cooldown handling to both quickstart workflows.

Changes:

  • Catch DidwwRateLimitedError during verification startup.
  • Display retry guidance and exit with status 1.
File Description
examples/​quickstart_sync.py Handles cooldown errors in the synchronous example.
examples/​quickstart_async.py Handles cooldown errors in the asynchronous example.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@senid231
senid231 merged commit 382b671 into didww:main Oct 1, 2026
6 checks passed
@senid231
senid231 deleted the examples-handle-cooldown branch October 1, 2026 12:38
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.

2 participants