Translate possible ErrBalanceTx
constructors to ErrCreatePayment
#4877
Labels
ADDING FEATURE
Mark a PR as adding a new feature, for auto-generated CHANGELOG
Deposit
IMPROVEMENT
Mark a PR as an improvement, for auto-generated CHANGELOG
The problem that you wish to solve
The current error handling in createPayment wraps the entire ErrBalanceTx type, including error cases that are impossible in the deposit wallet context. This makes the code less maintainable and creates confusion about which errors users might actually encounter. We need to streamline the error types to only include relevant, actionable errors specific to the payment creation process.
Description
Change createPayment’s ErrCreatePayment from wrapping ErrBalanceTx to inlining the subset of cases that are possible in the context of the deposit wallet. Impossible errors can be thrown with error (if we later realize we want to throw in IO, we can handle that later).
ACs
Implementation suggestions
Sketch
The text was updated successfully, but these errors were encountered: