diff --git a/DcCore/DcCore/DC/Wrapper.swift b/DcCore/DcCore/DC/Wrapper.swift index 2ad6f6975..892143841 100644 --- a/DcCore/DcCore/DC/Wrapper.swift +++ b/DcCore/DcCore/DC/Wrapper.swift @@ -10,6 +10,8 @@ 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() { var version = "" @@ -292,6 +294,8 @@ public class DcContext { } public func configure() { + maxConfigureProgress = 0 + lastWarningString = "" dc_configure(contextPointer) } diff --git a/DcCore/DcCore/DC/events.swift b/DcCore/DcCore/DC/events.swift index c52ab3100..80c297a7a 100644 --- a/DcCore/DcCore/DC/events.swift +++ b/DcCore/DcCore/DC/events.swift @@ -29,9 +29,11 @@ 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: + DcContext.shared.maxConfigureProgress = max(DcContext.shared.maxConfigureProgress, Int(data1)) DcContext.shared.logger?.info("configure progress: \(Int(data1)) \(Int(data2))") let nc = NotificationCenter.default DispatchQueue.main.async { diff --git a/deltachat-ios/Controller/AccountSetupController.swift b/deltachat-ios/Controller/AccountSetupController.swift index 6e35920b6..01b639e52 100644 --- a/deltachat-ios/Controller/AccountSetupController.swift +++ b/deltachat-ios/Controller/AccountSetupController.swift @@ -661,6 +661,8 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler { var errorMessage = ui["errorMessage"] as? String 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")\n\n(warning=\(DcContext.shared.lastWarningString) (progress=\(DcContext.shared.maxConfigureProgress))" } self.updateProgressAlert(error: errorMessage) } else if ui["done"] as! Bool {