VPN: TunnelsManager: s/TunnelsManagerError/TunnelActivationError/g;
This commit is contained in:
parent
699ace099c
commit
6a586b6f98
|
@ -152,9 +152,9 @@ extension TunnelDetailTableViewController {
|
|||
s.tunnelsManager.startActivation(of: s.tunnel) { [weak self] error in
|
||||
if let error = error {
|
||||
switch (error) {
|
||||
case TunnelsManagerError.noEndpoint:
|
||||
case TunnelActivationError.noEndpoint:
|
||||
self?.showErrorAlert(title: "Endpoint missing", message: "There must be at least one peer with an endpoint")
|
||||
case TunnelsManagerError.dnsResolutionFailed:
|
||||
case TunnelActivationError.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")
|
||||
|
|
|
@ -246,9 +246,9 @@ extension TunnelsListTableViewController {
|
|||
tunnelsManager.startActivation(of: tunnel) { error in
|
||||
if let error = error {
|
||||
switch (error) {
|
||||
case TunnelsManagerError.noEndpoint:
|
||||
case TunnelActivationError.noEndpoint:
|
||||
self?.showErrorAlert(title: "Endpoint missing", message: "There must be at least one peer with an endpoint")
|
||||
case TunnelsManagerError.dnsResolutionFailed:
|
||||
case TunnelActivationError.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")
|
||||
|
|
|
@ -12,7 +12,7 @@ protocol TunnelsManagerDelegate: class {
|
|||
func tunnelRemoved(at: Int)
|
||||
}
|
||||
|
||||
enum TunnelsManagerError: Error {
|
||||
enum TunnelActivationError: Error {
|
||||
case noEndpoint
|
||||
case dnsResolutionFailed
|
||||
case tunnelOperationFailed
|
||||
|
@ -210,11 +210,11 @@ class TunnelsManager {
|
|||
|
||||
func startActivation(of tunnel: TunnelContainer, completionHandler: @escaping (Error?) -> Void) {
|
||||
guard (tunnel.status == .inactive) else {
|
||||
completionHandler(TunnelsManagerError.attemptingActivationWhenTunnelIsNotInactive)
|
||||
completionHandler(TunnelActivationError.attemptingActivationWhenTunnelIsNotInactive)
|
||||
return
|
||||
}
|
||||
guard (currentTunnel == nil) else {
|
||||
completionHandler(TunnelsManagerError.attemptingActivationWhenAnotherTunnelIsActive)
|
||||
completionHandler(TunnelActivationError.attemptingActivationWhenAnotherTunnelIsActive)
|
||||
return
|
||||
}
|
||||
tunnel.startActivation(completionHandler: completionHandler)
|
||||
|
@ -223,7 +223,7 @@ class TunnelsManager {
|
|||
|
||||
func startDeactivation(of tunnel: TunnelContainer, completionHandler: @escaping (Error?) -> Void) {
|
||||
if (tunnel.status == .inactive) {
|
||||
completionHandler(TunnelsManagerError.attemptingDeactivationWhenTunnelIsInactive)
|
||||
completionHandler(TunnelActivationError.attemptingDeactivationWhenTunnelIsInactive)
|
||||
return
|
||||
}
|
||||
assert(tunnel.index == currentTunnel!.index)
|
||||
|
@ -305,7 +305,7 @@ class TunnelContainer: NSObject {
|
|||
guard (endpoints.contains(where: { $0 != nil })) else {
|
||||
DispatchQueue.main.async { [weak self] in
|
||||
self?.status = .inactive
|
||||
completionHandler(TunnelsManagerError.noEndpoint)
|
||||
completionHandler(TunnelActivationError.noEndpoint)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -328,7 +328,7 @@ class TunnelContainer: NSObject {
|
|||
s.dnsResolver = nil
|
||||
guard let resolvedEndpoints = resolvedEndpoints else {
|
||||
s.status = .inactive
|
||||
completionHandler(TunnelsManagerError.dnsResolutionFailed)
|
||||
completionHandler(TunnelActivationError.dnsResolutionFailed)
|
||||
return
|
||||
}
|
||||
s.startActivation(tunnelConfiguration: tunnelConfiguration,
|
||||
|
|
Loading…
Reference in New Issue