commit 40b33973e228ccd3f71b7d5e7083a9856a56856f
parent 1b2a9c70b0a729f1c3878abe12fa44889abbdc09
Author: Iván Ávalos <avalos@disroot.org>
Date: Wed, 17 Apr 2024 09:36:38 -0600
Small error handling fixes
Diffstat:
3 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/TalerWallet1/Views/Banking/ManualWithdraw.swift b/TalerWallet1/Views/Banking/ManualWithdraw.swift
@@ -116,14 +116,7 @@ struct ManualWithdraw: View {
if let exchangeBaseUrl = scopeInfo?.url {
symLog.log("getExchangeByUrl(\(exchangeBaseUrl))")
if exchange == nil || exchange?.tosStatus != .accepted {
- do {
- exchange = try await model.getExchangeByUrl(url: exchangeBaseUrl)
- } catch {
- // TODO: Error "Can't get Exchange / Payment Service Provider Info"
- symLog.log(error.localizedDescription)
- model.showError(.error(error))
- controller.playSound(0)
- }
+ exchange = try? await model.getExchangeByUrl(url: exchangeBaseUrl)
}
if !amountToTransfer.isZero {
do {
diff --git a/TalerWallet1/Views/Sheets/ErrorSheet.swift b/TalerWallet1/Views/Sheets/ErrorSheet.swift
@@ -40,7 +40,7 @@ struct ErrorSheet: View {
case .walletCoreError(let error):
if let json = error?.toJSON(), devMode {
self.init(title: walletCoreError, message: json, copyable: true, onDismiss: onDismiss)
- } else if let hint = error?.hint {
+ } else if let hint = error?.errorResponse?.hint ?? error?.hint {
self.init(title: walletCoreError, message: hint, copyable: false, onDismiss: onDismiss)
} else if let message = error?.message {
self.init(title: walletCoreError, message: message, copyable: false, onDismiss: onDismiss)
diff --git a/TalerWallet1/Views/Sheets/Payment/PaymentDone.swift b/TalerWallet1/Views/Sheets/Payment/PaymentDone.swift
@@ -50,10 +50,6 @@ struct PaymentDone: View {
// symLog.log(confirmPayResult as Any)
if confirmPayResult.type == "done" {
paymentDone = true
- } else {
- controller.playSound(0)
- // TODO: show error
- dismissTop()
}
}
}