aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-11-01 16:57:40 +0530
committerRoopesh Chander <roop@roopc.net>2018-11-01 16:57:40 +0530
commit39a457e40289f4e28c81975461454b28ed50f229 (patch)
treef19192e7a5ca9f989eb8a15aa614cefb7a03118a /WireGuard
parentConfigFile: WgQuickConfigFileWriter: Fix '[Peer]' section header (diff)
downloadwireguard-apple-39a457e40289f4e28c81975461454b28ed50f229.tar.xz
wireguard-apple-39a457e40289f4e28c81975461454b28ed50f229.zip
TunnelsManager: Better errors
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard')
-rw-r--r--WireGuard/WireGuard/VPN/TunnelsManager.swift8
1 files changed, 4 insertions, 4 deletions
diff --git a/WireGuard/WireGuard/VPN/TunnelsManager.swift b/WireGuard/WireGuard/VPN/TunnelsManager.swift
index 7c942ad..7d5dd50 100644
--- a/WireGuard/WireGuard/VPN/TunnelsManager.swift
+++ b/WireGuard/WireGuard/VPN/TunnelsManager.swift
@@ -15,8 +15,8 @@ protocol TunnelsManagerDelegate: class {
enum TunnelActivationError: Error {
case noEndpoint
case dnsResolutionFailed
- case tunnelOperationFailed
- case attemptingActivationWhenAnotherTunnelIsActive
+ case tunnelActivationFailed
+ case attemptingActivationWhenAnotherTunnelIsBusy(otherTunnelStatus: TunnelStatus)
case attemptingActivationWhenTunnelIsNotInactive
case attemptingDeactivationWhenTunnelIsInactive
}
@@ -237,7 +237,7 @@ class TunnelsManager {
return
}
guard (currentTunnel == nil) else {
- completionHandler(TunnelActivationError.attemptingActivationWhenAnotherTunnelIsActive)
+ completionHandler(TunnelActivationError.attemptingActivationWhenAnotherTunnelIsBusy(otherTunnelStatus: currentTunnel!.status))
return
}
setCurrentTunnel(tunnel: tunnel)
@@ -368,7 +368,7 @@ class TunnelContainer: NSObject {
completionHandler: @escaping (Error?) -> Void) {
if (recursionCount >= 8) {
os_log("startActivation: Failed after 8 attempts. Giving up with %{public}@.", log: OSLog.default, type: .error, "\(lastError!)")
- completionHandler(lastError)
+ completionHandler(TunnelActivationError.tunnelActivationFailed)
return
}