Skip to content

Improve error when config file is missing#10

Draft
DanGould wants to merge 1 commit intomasterfrom
overnight/issue-855
Draft

Improve error when config file is missing#10
DanGould wants to merge 1 commit intomasterfrom
overnight/issue-855

Conversation

@DanGould
Copy link
Copy Markdown
Owner

@DanGould DanGould commented Mar 2, 2026

Summary

  • When no config file exists, payjoin-cli now reports which paths were searched instead of showing a confusing "missing field" error
  • Tracks whether any config file (global ~/.config/payjoin-cli/config.toml or local config.toml) was actually loaded
  • Both BIP78 (V1) and BIP77 (V2) error paths updated consistently

Closes payjoin#855

Test plan

  • nix fmt -- --ci passes
  • cargo clippy --all-targets --keep-going --all-features -- -D warnings clean
  • codespell clean
  • CI passes on fork

Disclosure: co-authored by Claude

When no config file exists, the config library builds from defaults
alone, which fails with a confusing "missing field" error for
version-specific settings like ohttp_relays. Detect whether any
config file was actually loaded and, if not, append a hint telling
the user where to create one or to use CLI arguments instead.

Closes payjoin#855
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 2, 2026

Pull Request Test Coverage Report for Build 22572333999

Details

  • 9 of 25 (36.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.06%) to 82.425%

Changes Missing Coverage Covered Lines Changed/Added Lines %
payjoin-cli/src/app/config.rs 9 25 36.0%
Files with Coverage Reduction New Missed Lines %
payjoin-cli/src/app/config.rs 1 76.56%
Totals Coverage Status
Change from base Build 22572195695: -0.06%
Covered Lines: 10632
Relevant Lines: 12899

💛 - Coveralls

@DanGould DanGould force-pushed the overnight/issue-855 branch from b8b3a67 to c021627 Compare March 2, 2026 10:41
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 2, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch overnight/issue-855

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

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.

Error message is misleading when config file is not present

2 participants