Skip to content

Propagate sub-config parsing error#575

Merged
DanGould merged 1 commit intopayjoin:masterfrom
DanGould:propagate-config-err
Mar 13, 2025
Merged

Propagate sub-config parsing error#575
DanGould merged 1 commit intopayjoin:masterfrom
DanGould:propagate-config-err

Conversation

@DanGould
Copy link
Contributor

For example, if the [v2] field had a pj_directory config field defined, but the URL parsing failed, the error would be swallowed before this change.

This now propagates that error to the CLI.


The error propagation still isn't perfect, and some config errors get swallowed without complete context, but this is progress.

@DanGould DanGould force-pushed the propagate-config-err branch from d8acebe to 83c0e75 Compare March 13, 2025 15:51
For example, if the [v2] field had a pj_directory config field defined,
but the URL parsing failed, the error would be swallowed before this
change.

This now propagates that error to the CLI.
Copy link
Collaborator

@spacebear21 spacebear21 left a comment

Choose a reason for hiding this comment

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

tACK d17bf0d

Example error message before:

❯ cargo run -- receive 1
     Running `/Users/spacebear/Projects/rust-payjoin/target/debug/payjoin-cli receive 1`
Error: V2 configuration is required for BIP77 mode

After:

❯ cargo run -- receive 1
     Running `/Users/spacebear/Projects/rust-payjoin/target/debug/payjoin-cli receive 1`
Error: Valid V2 configuration is required for BIP77 mode: missing field `ohttp_relay`

@DanGould DanGould merged commit a97264a into payjoin:master Mar 13, 2025
7 checks passed
@coveralls
Copy link
Collaborator

coveralls commented Mar 13, 2025

Pull Request Test Coverage Report for Build 13838915414

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 4 of 14 (28.57%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.06%) to 80.505%

Changes Missing Coverage Covered Lines Changed/Added Lines %
payjoin-cli/src/app/config.rs 4 14 28.57%
Totals Coverage Status
Change from base Build 13838537049: -0.06%
Covered Lines: 4782
Relevant Lines: 5940

💛 - Coveralls

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