gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]