[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 07/29: crash fix 8780
From: |
gnunet |
Subject: |
[taler-taler-ios] 07/29: crash fix 8780 |
Date: |
Tue, 28 May 2024 09:05:50 +0200 |
This is an automated email from the git hooks/post-receive script.
marc-stibane pushed a commit to branch master
in repository taler-ios.
commit afc1a89342cc21183c26da1dbe0cae6a0684d071
Author: Marc Stibane <marc@taler.net>
AuthorDate: Wed May 8 22:26:33 2024 +0200
crash fix 8780
---
TalerWallet1/Backend/WalletBackendError.swift | 2 +-
TalerWallet1/Backend/WalletCore.swift | 22 ++++++++++++++++++----
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/TalerWallet1/Backend/WalletBackendError.swift
b/TalerWallet1/Backend/WalletBackendError.swift
index 0a2c693..f2cfec9 100644
--- a/TalerWallet1/Backend/WalletBackendError.swift
+++ b/TalerWallet1/Backend/WalletBackendError.swift
@@ -32,7 +32,7 @@ struct WalletBackendResponseError: Codable {
/// Numeric error code defined defined in the GANA gnu-taler-error-codes
registry.
var code: Int
- var when: Timestamp
+ var when: Timestamp?
/// English description of the error code.
var hint: String
diff --git a/TalerWallet1/Backend/WalletCore.swift
b/TalerWallet1/Backend/WalletCore.swift
index cec27c2..570f649 100644
--- a/TalerWallet1/Backend/WalletCore.swift
+++ b/TalerWallet1/Backend/WalletCore.swift
@@ -267,14 +267,28 @@ extension WalletCore {
} // switch
} // type
} // 3 components
- } catch { // rethrows
- symLog.log(jsonData) // TODO: .error
- throw WalletBackendError.deserializationError
+ return
+ } catch DecodingError.dataCorrupted(let context) {
+ print(context)
+ } catch DecodingError.keyNotFound(let key, let context) {
+ print("Key '\(key)' not found:", context.debugDescription)
+ print("codingPath:", context.codingPath)
+ } catch DecodingError.valueNotFound(let value, let context) {
+ print("Value '\(value)' not found:", context.debugDescription)
+ print("codingPath:", context.codingPath)
+ } catch DecodingError.typeMismatch(let type, let context) {
+ print("Type '\(type)' mismatch:", context.debugDescription)
+ print("codingPath:", context.codingPath)
+ } catch let error { // rethrows
+ symLog.log(error) // TODO: .error
}
+ throw WalletBackendError.walletCoreError(nil) // TODO: error?
}
@MainActor private func handleNotification(_ anyCodable: AnyCodable?)
throws {
- guard let anyPayload = anyCodable else { throw
WalletBackendError.deserializationError }
+ guard let anyPayload = anyCodable else {
+ throw WalletBackendError.deserializationError
+ }
do {
let jsonData = try JSONEncoder().encode(anyPayload)
let payload = try JSONDecoder().decode(Payload.self, from:
jsonData)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] branch master updated (18d895c -> c4761b4), gnunet, 2024/05/28
- [taler-taler-ios] 04/29: cleanup, gnunet, 2024/05/28
- [taler-taler-ios] 03/29: checkInternetConnection, gnunet, 2024/05/28
- [taler-taler-ios] 07/29: crash fix 8780,
gnunet <=
- [taler-taler-ios] 05/29: CurrencyFormatter for manual withdrawals, gnunet, 2024/05/28
- [taler-taler-ios] 02/29: currencyInfo instead of readableDescription, gnunet, 2024/05/28
- [taler-taler-ios] 06/29: non-breaking space, gnunet, 2024/05/28
- [taler-taler-ios] 01/29: Bank links, gnunet, 2024/05/28
- [taler-taler-ios] 13/29: addingPercentEncoding, gnunet, 2024/05/28
- [taler-taler-ios] 24/29: Logging, gnunet, 2024/05/28
- [taler-taler-ios] 29/29: Bump version to 0.11.0 (0.11.1), gnunet, 2024/05/28
- [taler-taler-ios] 19/29: checkPayForTemplate preparation, gnunet, 2024/05/28
- [taler-taler-ios] 15/29: Decode payee, gnunet, 2024/05/28
- [taler-taler-ios] 14/29: merge-kyc translation, gnunet, 2024/05/28