aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-12-06 15:58:27 +0530
committerRoopesh Chander <roop@roopc.net>2018-12-07 12:36:19 +0530
commit8d26a3c5360a89605b2ecf6c5ad8edadd8eea590 (patch)
tree52f570268e04f8df77790dcfab40a560fa0d9df6 /WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
parentError presenter: Always handle the passed error (diff)
downloadwireguard-apple-8d26a3c5360a89605b2ecf6c5ad8edadd8eea590.tar.xz
wireguard-apple-8d26a3c5360a89605b2ecf6c5ad8edadd8eea590.zip
Error handling: Cleanup Tunnels Manager errors
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift')
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift9
1 files changed, 4 insertions, 5 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
index 74c6e57..ca5e6a8 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
@@ -99,14 +99,13 @@ class TunnelEditTableViewController: UITableViewController {
} else {
// We're adding a new tunnel
tunnelsManager.add(tunnelConfiguration: tunnelConfiguration,
- activateOnDemandSetting: activateOnDemandSetting) { [weak self] (tunnel, error) in
- if let error = error {
+ activateOnDemandSetting: activateOnDemandSetting) { [weak self] result in
+ if let error = result.error {
ErrorPresenter.showErrorAlert(error: error, from: self)
} else {
+ let tunnel: TunnelContainer = result.value!
self?.dismiss(animated: true, completion: nil)
- if let tunnel = tunnel {
- self?.delegate?.tunnelSaved(tunnel: tunnel)
- }
+ self?.delegate?.tunnelSaved(tunnel: tunnel)
}
}
}