Return actual error from get_payment_quote?? #1271

Closed
opened 2025-11-14 19:14:30 +00:00 by gudnuf · 1 comment
gudnuf commented 2025-11-14 19:14:30 +00:00 (Migrated from github.com)

Current behavior

When a payment processor throws an error from their get_payment_quote implementation the mint will always return UnsupportedUnit. This happens here

Question

Is this intentional? Would it make more sense to return the actual error?

The reason I'm asking is that I want to validate the melt request in my payment processor and if invalid I want the wallet to get the actual error that caused the request to fail.

## Current behavior When a payment processor throws an error from their `get_payment_quote` implementation the mint will always return `UnsupportedUnit`. This happens [here](https://github.com/cashubtc/cdk/blob/e5882dc2ebef3b964cbd4c473dc27af9b051e792/crates/cdk/src/mint/melt.rs#L160-L180) ## Question Is this intentional? Would it make more sense to return the actual error? The reason I'm asking is that I want to validate the melt request in my payment processor and if invalid I want the wallet to get the actual error that caused the request to fail.
thesimplekid commented 2025-11-14 20:32:40 +00:00 (Migrated from github.com)

Is this intentional? Would it make more sense to return the actual error?

Ah no I've seen this before so knew something was wrong but never looked into where it was happening.

We should return a better error.

> Is this intentional? Would it make more sense to return the actual error? Ah no I've seen this before so knew something was wrong but never looked into where it was happening. We should return a better error.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cashubtc/cdk#1271
No description provided.