commit 8d9f728cf0b6f60236e619129e54993f56d41f15
parent 2c62741e25c5b288ef7f2949748da6f6b9c2861e
Author: Daniel D’Aquino <daniel@daquino.me>
Date: Fri, 20 Jun 2025 18:30:52 -0700
Display wallet response error if available
This commit improves error handling in the wallet's "send" feature, by
displaying more specific wallet response error messages when available.
Closes: https://github.com/damus-io/damus/issues/3095
Changelog-Fixed: Improve error handling on wallet send feature
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/damus/Views/Wallet/SendPaymentView.swift b/damus/Views/Wallet/SendPaymentView.swift
@@ -217,6 +217,10 @@ struct SendPaymentView: View {
))
}
}
+ else if let error = error as? WalletConnect.WalletResponseErr,
+ let humanReadableError = error.humanReadableError {
+ sendState = .failed(error: humanReadableError)
+ }
else {
sendState = .failed(error: .init(
user_visible_description: NSLocalizedString("An unexpected error occurred.", comment: "A human-readable error message"),