VPN: Better error messages
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
@@ -232,7 +232,16 @@ extension TunnelsListTableViewController {
|
||||
guard let s = self, let tunnelsManager = s.tunnelsManager else { return }
|
||||
if (isOn) {
|
||||
tunnelsManager.startActivation(of: tunnel) { error in
|
||||
print("Error while activating: \(String(describing: error))")
|
||||
if let error = error {
|
||||
switch (error) {
|
||||
case TunnelsManagerError.noEndpoint:
|
||||
self?.showErrorAlert(title: "Endpoint missing", message: "There must be atleast one peer with an endpoint")
|
||||
case TunnelsManagerError.dnsResolutionFailed:
|
||||
self?.showErrorAlert(title: "DNS Failure", message: "One or more endpoint domains could not be resolved")
|
||||
default:
|
||||
self?.showErrorAlert(title: "Internal error", message: "The tunnel could not be activated")
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tunnelsManager.startDeactivation(of: tunnel) { error in
|
||||
|
||||
Reference in New Issue
Block a user