diff --git a/Sources/Experiment/ExperimentClient.swift b/Sources/Experiment/ExperimentClient.swift index 797fdb2..3820ad7 100644 --- a/Sources/Experiment/ExperimentClient.swift +++ b/Sources/Experiment/ExperimentClient.swift @@ -679,11 +679,10 @@ internal class DefaultExperimentClient : NSObject, ExperimentClient { } private func shouldRetryFetch(_ e: Error) -> Bool { - if (e is FetchError) { - let fetchError = e as! FetchError - return fetchError.statusCode < 400 || fetchError.statusCode >= 500 || fetchError.statusCode == 429 + guard let e = e as FetchError else { + return true } - return true + return fetchError.statusCode < 400 || fetchError.statusCode >= 500 || fetchError.statusCode == 429 } }