diff options
author | Roopesh Chander <roop@roopc.net> | 2018-12-03 15:34:58 +0530 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2018-12-03 18:51:42 +0530 |
commit | e1b258353c312a87129d771405148e83f0af5a04 (patch) | |
tree | c2f70b3985167cd2bb321a6992fcb23e29ad1de5 /WireGuard/WireGuard/UI | |
parent | Settings: Export log file (diff) | |
download | wireguard-apple-e1b258353c312a87129d771405148e83f0af5a04.tar.xz wireguard-apple-e1b258353c312a87129d771405148e83f0af5a04.zip |
VPN: Error out when tunnel activation fails because there's no internet
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI')
-rw-r--r-- | WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift | 6 | ||||
-rw-r--r-- | WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift b/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift index 8aa0c1a..1116f61 100644 --- a/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift +++ b/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift @@ -21,8 +21,12 @@ class ErrorPresenter { return ("Unable to remove tunnel", "Internal error") // TunnelActivationError - case TunnelActivationError.tunnelActivationFailed: + case TunnelActivationError.tunnelActivationAttemptFailed: return ("Activation failure", "The tunnel could not be activated due to an internal error") + case TunnelActivationError.tunnelActivationFailedInternalError: + return ("Activation failure", "The tunnel could not be activated due to an internal error") + case TunnelActivationError.tunnelActivationFailedNoInternetConnection: + return ("Activation failure", "No internet connection") // Importing a zip file case ZipArchiveError.cantOpenInputZipFile: diff --git a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift index 6e77433..c2c7b58 100644 --- a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift +++ b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift @@ -80,6 +80,7 @@ class TunnelsListTableViewController: UIViewController { busyIndicator.stopAnimating() tunnelsManager.delegate = s + tunnelsManager.activationDelegate = s s.tunnelsManager = tunnelsManager s.onTunnelsManagerReady?(tunnelsManager) s.onTunnelsManagerReady = nil @@ -312,6 +313,14 @@ extension TunnelsListTableViewController: TunnelsManagerDelegate { } } +// MARK: TunnelActivationDelegate + +extension TunnelsListTableViewController: TunnelActivationDelegate { + func tunnelActivationFailed(tunnel: TunnelContainer, error: TunnelActivationError) { + ErrorPresenter.showErrorAlert(error: error, from: self) + } +} + class TunnelsListTableViewCell: UITableViewCell { static let id: String = "TunnelsListTableViewCell" var tunnel: TunnelContainer? { |