breez / breez-sdk-greenlight

MIT License
244 stars 43 forks source link

Return a specific error when onchain funds are not enough to pay for onchain fees #1059

Closed danielgranhao closed 3 months ago

danielgranhao commented 3 months ago

At the moment, prepare_redeem_onchain_funds returns NodeError::generic("Insufficient funds to pay fees") when funds are not enough to pay for onchain fees. It would be useful if a specific error (e.g. NodeError:InsufficientFundsForFees) was returned so that SDK integrators could react without having to parse the error string.

roeierez commented 3 months ago

@danielgranhao makes sense. How about NodeError::InsufficientFunds ? sounds a bit more generic and still usefull.

danielgranhao commented 3 months ago

@roeierez SGTM