improve error dialog on payjoin receiver error
What changed, and why it matters
This commit only improves an error message shown to the user when a payjoin transaction fails. It adds a specific catch block so that an existing 'PayjoinReceiverException' is logged and re-thrown with its original message intact, instead of being wrapped in a generic 'Payjoin error'. There is no security fix here—just better error reporting.
No security action required. Treat as a routine UX/logging improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds a catch clause for PayjoinReceiverException in Payjoin.java. Previously, this exception type fell through to the generic Exception handler, which would wrap it in a new PayjoinReceiverException with the generic message ‘Payjoin error’. Now it is caught explicitly, logged as ‘Payjoin receiver error’, and re-thrown unchanged. This preserves the original error detail for the UI dialog but does not alter validation, cryptography, network behavior, or trust assumptions.
Changed components
src/main/java/com/sparrowwallet/sparrow/payjoin/Payjoin.javaInspect captured patch +3 / −0
diff --git a/src/main/java/com/sparrowwallet/sparrow/payjoin/Payjoin.java b/src/main/java/com/sparrowwallet/sparrow/payjoin/Payjoin.java
index ada911f..dad575c 100644
--- a/src/main/java/com/sparrowwallet/sparrow/payjoin/Payjoin.java
+++ b/src/main/java/com/sparrowwallet/sparrow/payjoin/Payjoin.java
@@ -108,6 +108,9 @@ public class Payjoin {
} catch(PSBTParseException e) {
log.error("Error parsing received PSBT", e);
throw new PayjoinReceiverException("Payjoin receiver returned invalid PSBT", e);
+ } catch(PayjoinReceiverException e) {
+ log.error("Payjoin receiver error", e);
+ throw e;
} catch(Exception e) {
log.error("Payjoin error", e);
throw new PayjoinReceiverException("Payjoin error", e);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.