Skip to content

Conversation

@abhinavraajput
Copy link

Pull Request Checklist

Please confirm the following before requesting review:

Fixes #1258

This PR improves error handling in payjoin-cli by propagating the
underlying Bitcoin RPC error message instead of replacing it with
a generic error. This allows users to see actionable RPC errors
such as unloaded wallets.

AI Assistance Disclosure:
I used ChatGPT to understand the codebase and reason about the fix.
The implementation was written and reviewed manually.

@benalleng benalleng self-requested a review January 8, 2026 14:04
Copy link
Collaborator

@benalleng benalleng left a comment

Choose a reason for hiding this comment

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

Always nice to see errors getting propagated further but I am skeptical if this is the relevant line in the case of this issue. Notice that the "Caused by:" return states a 500 error where this should never be able to deviate from the return string in the diff.

@abhinavraajput
Copy link
Author

@benalleng Thanks for the review!

That makes sense — I agree this change may not be the layer where the
500 status is being introduced for this issue. I’ll take another look
at where the Bitcoin RPC error is being mapped to an HTTP 500 response
and try to address the propagation closer to that boundary instead.

@zealsham
Copy link
Collaborator

@abhinavraajput i think the work required to fix this starts from looking at the upstream code and work down from there

@abhinavraajput
Copy link
Author

@zealsham Thanks, that’s helpful.

I’ll take a look at the upstream error handling (e.g. where the
Bitcoin RPC / HTTP response is constructed) and trace how the 500
status is introduced before it reaches the CLI. If it turns out
this is best fixed upstream, I’m happy to close this PR and follow
up in the appropriate repository instead.

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.

payjoin-cli RPC errors are obscured

3 participants