Quellcode durchsuchen

temorary show the last warning in addition to the last error, just in case the core does sth. wrong, might help to get a grip on some weird errors

B. Petersen vor 5 Jahren
Ursprung
Commit
ccf23aae68

+ 2 - 0
DcCore/DcCore/DC/Wrapper.swift

@@ -10,6 +10,7 @@ public class DcContext {
     public var logger: Logger?
     let contextPointer: OpaquePointer
     public var lastErrorString: String?
+    public var lastWarningString: String = "" // temporary thing to get a grip on some weird errors
     public var maxConfigureProgress: Int = 0 // temporary thing to get a grip on some weird errors
 
     private init() {
@@ -294,6 +295,7 @@ public class DcContext {
 
     public func configure() {
         maxConfigureProgress = 0
+        lastWarningString = ""
         dc_configure(contextPointer)
     }
 

+ 1 - 0
DcCore/DcCore/DC/events.swift

@@ -29,6 +29,7 @@ public func callbackSwift(event: CInt, data1: CUnsignedLong, data2: CUnsignedLon
 
     case DC_EVENT_WARNING:
         let s = String(cString: data2String)
+        DcContext.shared.lastWarningString = s
         DcContext.shared.logger?.warning("event: \(s)")
 
     case DC_EVENT_CONFIGURE_PROGRESS:

+ 1 - 1
deltachat-ios/Controller/AccountSetupController.swift

@@ -662,7 +662,7 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
                     if let appDelegate = UIApplication.shared.delegate as? AppDelegate, appDelegate.reachability.connection == .none {
                         errorMessage = String.localized("login_error_no_internet_connection")
                     } else {
-                        errorMessage = "\(errorMessage ?? "no message") (progress=\(DcContext.shared.maxConfigureProgress))"
+                        errorMessage = "\(errorMessage ?? "no message")\n\n(warning=\(DcContext.shared.lastWarningString) (progress=\(DcContext.shared.maxConfigureProgress))"
                     }
                     self.updateProgressAlert(error: errorMessage)
                 } else if ui["done"] as! Bool {