Skip to content

Improve error when config file is missing#1632

Open
benalleng wants to merge 1 commit into
payjoin:masterfrom
benalleng:payjoin-cli-missing-config
Open

Improve error when config file is missing#1632
benalleng wants to merge 1 commit into
payjoin:masterfrom
benalleng:payjoin-cli-missing-config

Conversation

@benalleng

Copy link
Copy Markdown
Collaborator

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.

pulled from DanGould#10

Closes #855

Pull Request Checklist

Please confirm the following before requesting review:

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
@benalleng benalleng requested a review from DanGould June 9, 2026 16:49
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 27221858423

Coverage decreased (-0.06%) to 85.143%

Details

  • Coverage decreased (-0.06%) from the base build.
  • Patch coverage: 16 uncovered changes across 1 file (9 of 25 lines covered, 36.0%).
  • 1 coverage regression across 1 file.

Uncovered Changes

File Changed Covered %
payjoin-cli/src/app/config.rs 25 9 36.0%

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
payjoin-cli/src/app/config.rs 1 80.35%

Coverage Stats

Coverage Status
Relevant Lines: 14727
Covered Lines: 12539
Line Coverage: 85.14%
Coverage Strength: 370.76 hits per line

💛 - Coveralls

@zealsham

zealsham commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

tAck

No config file found. Searched: /Users/Apple User/Library/Application Support/payjoin-cli/config.toml, config.toml (current directory). Create a config.toml or provide configuration via CLI arguments.


do you think making it " config.toml in (current directory)" is better

@benalleng

Copy link
Copy Markdown
Collaborator Author

Ehh I'm not too plussed about perfect grammar in cli reponses

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

4 participants