Skip to content

fix(domain): fail quote when it can't be saved for purchase - #324

Merged
jpage-godaddy merged 2 commits into
mainfrom
quote-write-bug
Oct 14, 2026
Merged

jpage-godaddy merged 2 commits into
mainfrom
quote-write-bug

Conversation

@jpage-godaddy

@jpage-godaddy jpage-godaddy commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

gddy domain quote now stops with an error when it can't save the quote on this machine. Previously it printed the quote and suggested domain purchase --quote-token ..., which then failed with "no cached quote for that token" — the only hint was a log line that is hidden in normal use.

domain purchase can only rebuild a quote from the copy saved by domain quote, so a quote that isn't saved can't be bought from that machine.

Behavior

  • If the quote can't be saved, the command fails with a CONFIG_ERROR that names the file and the reason, for example "could not save the quote for example.com to /home/me/.config/gddy/quotes.json: ...".
  • The suggested fix says to resolve the reported problem (for example, make that folder writable or free up disk space) and re-run gddy domain quote <domain>. Quotes are free, so retrying costs nothing.
  • On Linux it also explains how to save somewhere else (XDG_CONFIG_HOME) and reminds you to use the same setting when running domain purchase. macOS and Windows get no relocation hint because the folder can't be redirected there.
  • If no folder can be found at all, the error says what to check for the platform.
  • domain purchase gives the same platform-specific advice, with a stable error code and suggested fix, when it can't find the folder.

Testing

  • New unit tests cover an unwritable save location (error code, file and folder named, re-quote command in the fix, nothing saved) and the missing-folder error.
  • cargo check, clippy -D warnings, cargo test --workspace, cargo fmt --check and the module-size check pass.

🤖 Generated with Claude Code

`gddy domain quote` now stops with an error when it can't save the quote
on this machine, instead of printing the quote and suggesting a purchase
step that would fail with "no cached quote for that token".

The error names the file it tried to write and the reason, and tells you
how to fix it: make the folder writable or free up disk space, then
re-run the quote (quotes are free). On Linux and Windows it also says how
to save somewhere else (`XDG_CONFIG_HOME` or `APPDATA`) and to use the
same setting when running `domain purchase`.

`domain purchase` no longer tells macOS and Windows users to set
`XDG_CONFIG_HOME` when it can't find the folder where quotes are saved.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Windows recovery guidance is ineffective, and purchase still omits structured configuration-error metadata.

3 open findings
What changed in this PR

Makes domain quoting fail when its purchase cache cannot be saved.

Changes:

  • Converts quote-cache write failures into actionable CONFIG_ERROR responses.
  • Adds platform-specific recovery guidance.
  • Adds failure-path unit tests.
File Description
rust/​src/​domain/​quote.rs Propagates quote-cache save failures.
rust/​src/​domain/​quote_cache.rs Builds recovery errors and adds tests.
rust/​src/​domain/​purchase.rs Updates missing-cache-directory guidance.

🧠 Review effort: Balanced


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

Comment thread rust/src/domain/purchase.rs Outdated
Comment thread rust/src/domain/quote_cache.rs Outdated
Comment thread rust/src/domain/quote_cache.rs
Only Linux can move the folder where quotes are saved (via
`XDG_CONFIG_HOME`); macOS and Windows derive it from the account, so the
error no longer suggests setting `APPDATA`. The fix now leads with
resolving the reported problem, keeping "make the folder writable or free
up disk space" as examples, since the cause can be anything the file
system reports.

`domain purchase` also returns its missing-folder failure with a stable
error code and a suggested fix, matching `domain quote`.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused error-handling changes are consistent, actionable, and adequately tested.

0 open findings

3 resolved since last review

🧠 Review effort: Balanced

@jpage-godaddy
jpage-godaddy merged commit 89d8090 into main Oct 14, 2026
7 checks passed
@jpage-godaddy
jpage-godaddy deleted the quote-write-bug branch October 14, 2026 22:50
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.

3 participants