Skip to content

fix: payments add always returns URL, treats browser failure as non-fatal#72

Open
thill2-godaddy wants to merge 1 commit into
godaddy:rust-portfrom
thill2-godaddy:wsl2-fixes
Open

fix: payments add always returns URL, treats browser failure as non-fatal#72
thill2-godaddy wants to merge 1 commit into
godaddy:rust-portfrom
thill2-godaddy:wsl2-fixes

Conversation

@thill2-godaddy

Copy link
Copy Markdown

Summary

  • payments add now always includes the payment URL in the JSON result, so it's visible (and clickable in modern terminals) regardless of whether the browser opened
  • Browser launch failure is no longer treated as a fatal error — the command returns Ok in both cases
  • Removes unused std::io::Write import

Background

On WSL2 (and other headless Linux environments), xdg-open exits with code 3 because no desktop environment is configured. The previous code returned an Err on browser launch failure, surfacing a confusing error message even though the URL had already been printed to stderr. This made the command unusable on WSL2 without a workaround.

Test plan

  • Run gddy payments add on WSL2 — should return the URL in the result instead of an error
  • Run gddy payments add on macOS/Windows — browser should open and URL should still appear in the result

🤖 Generated with Claude Code

…atal

On WSL2 (and other headless environments) xdg-open exits with code 3
because no desktop environment is configured, causing the command to
fail with an error even though the URL was already printed to stderr.

Always include the URL in the JSON result and return Ok regardless of
whether the browser opened, so the user can click or copy the URL in
any environment.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant