diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2020-07-17 15:26:56 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2020-07-22 18:35:43 +0300 |
| commit | 18c0b739b4aec6ae606c42879ec83b40ce00a1fb (patch) | |
| tree | e6c86fb6c0b68f4c8b3241e89232531b71276f7f /ios | |
| parent | 40149a7e14bc9c10056e8a8cb5b9e333f80d5a7e (diff) | |
| download | mullvadvpn-18c0b739b4aec6ae606c42879ec83b40ce00a1fb.tar.xz mullvadvpn-18c0b739b4aec6ae606c42879ec83b40ce00a1fb.zip | |
Refactor the error matching code
Diffstat (limited to 'ios')
| -rw-r--r-- | ios/MullvadVPN/AutomaticKeyRotationManager.swift | 2 | ||||
| -rw-r--r-- | ios/MullvadVPN/RelayCache.swift | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ios/MullvadVPN/AutomaticKeyRotationManager.swift b/ios/MullvadVPN/AutomaticKeyRotationManager.swift index 9d6b8677a0..a58940d76f 100644 --- a/ios/MullvadVPN/AutomaticKeyRotationManager.swift +++ b/ios/MullvadVPN/AutomaticKeyRotationManager.swift @@ -228,7 +228,7 @@ class AutomaticKeyRotationManager { nextRotationTime = .now() + .seconds(kRetryIntervalOnFailure) } - case .failure(.rest(.network(let urlError))) where urlError.code == .cancelled: + case .failure(.rest(.network(URLError.cancelled))): os_log(.default, log: tunnelProviderLog, "Key rotation was cancelled") break diff --git a/ios/MullvadVPN/RelayCache.swift b/ios/MullvadVPN/RelayCache.swift index e72c8e9106..fc7a009a02 100644 --- a/ios/MullvadVPN/RelayCache.swift +++ b/ios/MullvadVPN/RelayCache.swift @@ -350,7 +350,7 @@ class RelayCache { case .readPrebundledRelays, .decodePrebundledRelays, .decodeCache: return true - case .readCache(let error as CocoaError) where error.code == .fileReadNoSuchFile: + case .readCache(CocoaError.fileReadNoSuchFile): return true default: |
