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
if (tunnel == s.tunnelBeingActivated) {
if (session.status == .disconnected) {
let error = (InternetReachability.currentStatus() == .notReachable ?
TunnelsManagerError.tunnelActivationFailedNoInternetConnection :
TunnelsManagerError.tunnelActivationFailedInternalError)
s.activationDelegate?.tunnelActivationFailed(tunnel: tunnel, error: error)
if (InternetReachability.currentStatus() == .notReachable) {
let error = TunnelsManagerError.tunnelActivationFailedNoInternetConnection
s.activationDelegate?.tunnelActivationFailed(tunnel: tunnel, error: error)
}
s.tunnelBeingActivated = nil
} else if (session.status == .connected) {
s.tunnelBeingActivated = nil