diff --git a/CHANGELOG.md b/CHANGELOG.md index 95b7505d..62230368 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +### 0.10.4 +- **Fix**: `noConnection` error. + ### 0.10.3 - **Fix**: `mappingQueue` of `SessionManager`. diff --git a/LeadKit.podspec b/LeadKit.podspec index 02549dca..0dc11137 100644 --- a/LeadKit.podspec +++ b/LeadKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "LeadKit" - s.version = "0.10.3" + s.version = "0.10.4" s.summary = "iOS framework with a bunch of tools for rapid development" s.homepage = "https://github.com/TouchInstinct/LeadKit" s.license = "Apache License, Version 2.0" diff --git a/Sources/Extensions/Alamofire/DataRequest+Extensions.swift b/Sources/Extensions/Alamofire/DataRequest+Extensions.swift index 64ab85d3..4ecf988f 100644 --- a/Sources/Extensions/Alamofire/DataRequest+Extensions.swift +++ b/Sources/Extensions/Alamofire/DataRequest+Extensions.swift @@ -134,6 +134,15 @@ private extension ObservableType { case let afError as AFError: switch afError { + case let .sessionTaskFailed(error): + switch error { + case let urlError as URLError where urlError.code == .notConnectedToInternet: + resultError = .noConnection + + default: + resultError = .network(error: error, response: response) + } + case .responseSerializationFailed, .responseValidationFailed: resultError = .invalidResponse(error: afError, response: response)