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>
This commit is contained in:
@@ -217,6 +217,10 @@ struct SendPaymentView: View {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if let error = error as? WalletConnect.WalletResponseErr,
|
||||||
|
let humanReadableError = error.humanReadableError {
|
||||||
|
sendState = .failed(error: humanReadableError)
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
sendState = .failed(error: .init(
|
sendState = .failed(error: .init(
|
||||||
user_visible_description: NSLocalizedString("An unexpected error occurred.", comment: "A human-readable error message"),
|
user_visible_description: NSLocalizedString("An unexpected error occurred.", comment: "A human-readable error message"),
|
||||||
|
|||||||
Reference in New Issue
Block a user