TunnelsManager: Error out only on no-internet scenario

The other scenario happens even during reloading of a tunnel for activation.

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2018-12-11 03:48:24 +05:30
parent 1fd0c56f08
commit 1ded24f0e0

View File

@ -286,10 +286,10 @@ class TunnelsManager {
// In case our attempt to start the tunnel, didn't succeed // In case our attempt to start the tunnel, didn't succeed
if (tunnel == s.tunnelBeingActivated) { if (tunnel == s.tunnelBeingActivated) {
if (session.status == .disconnected) { if (session.status == .disconnected) {
let error = (InternetReachability.currentStatus() == .notReachable ? if (InternetReachability.currentStatus() == .notReachable) {
TunnelsManagerError.tunnelActivationFailedNoInternetConnection : let error = TunnelsManagerError.tunnelActivationFailedNoInternetConnection
TunnelsManagerError.tunnelActivationFailedInternalError) s.activationDelegate?.tunnelActivationFailed(tunnel: tunnel, error: error)
s.activationDelegate?.tunnelActivationFailed(tunnel: tunnel, error: error) }
s.tunnelBeingActivated = nil s.tunnelBeingActivated = nil
} else if (session.status == .connected) { } else if (session.status == .connected) {
s.tunnelBeingActivated = nil s.tunnelBeingActivated = nil