aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-11-01 18:59:58 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-11-01 19:01:43 +0100
commitc2d76b9c450d50e61f6229ea9af7b6b08f92d099 (patch)
treed5ec17fbc13b78769b16ad19b5b07129499e811f /WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift
parentQR code: Fix what happens when an error is shown (diff)
downloadwireguard-apple-c2d76b9c450d50e61f6229ea9af7b6b08f92d099.tar.xz
wireguard-apple-c2d76b9c450d50e61f6229ea9af7b6b08f92d099.zip
Global: fix up strings
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift')
-rw-r--r--WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift14
1 files changed, 4 insertions, 10 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift b/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift
index edb3a60..fa5f6d0 100644
--- a/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift
@@ -46,7 +46,7 @@ class SettingsTableViewController: UITableViewController {
func exportConfigurationsAsZipFile(sourceView: UIView) {
guard let tunnelsManager = tunnelsManager, tunnelsManager.numberOfTunnels() > 0 else {
- showErrorAlert(title: "Nothing to export", message: "There are no tunnel configurations to export")
+ showErrorAlert(title: "Nothing to export", message: "There are no tunnels to export")
return
}
var inputsToArchiver: [(fileName: String, contents: Data)] = []
@@ -76,21 +76,15 @@ class SettingsTableViewController: UITableViewController {
os_log("Failed to delete file: %{public}@ : %{public}@", log: OSLog.default, type: .error, destinationURL.absoluteString, error.localizedDescription)
}
- var ok = false
do {
try ZipArchive.archive(inputs: inputsToArchiver, to: destinationURL)
- ok = true
- } catch {
- os_log("Failed to create archive: %{public}@ : %{public}@", log: OSLog.default, type: .error, destinationURL.absoluteString)
- }
-
- if (ok) {
let activityVC = UIActivityViewController(activityItems: [destinationURL], applicationActivities: nil)
// popoverPresentationController shall be non-nil on the iPad
activityVC.popoverPresentationController?.sourceView = sourceView
present(activityVC, animated: true)
- } else {
- showErrorAlert(title: "Could not export", message: "There was an error creating the tunnel configuration archive")
+
+ } catch (let error) {
+ showErrorAlert(title: "Unable to export", message: "There was an error exporting the tunnel configuration archive: \(String(describing: error))")
}
}