Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
ConnectError.unavailable
when client is offline (#328)
Resolves #325. When turning the device's wifi off, the following was observed with URLSession: Before: ``` ▿ Optional<ConnectError> ▿ some : ConnectError - code : Connect.Code.unknown ▿ message : Optional<String> - some : "The Internet connection appears to be offline." ▿ exception : Optional<Error> - some : Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." ``` Based on the discussion in the issue linked above, this PR updates the code to be `.unavailable`: ``` ▿ Optional<ConnectError> ▿ some : ConnectError - code : Connect.Code.unavailable ▿ message : Optional<String> - some : "The Internet connection appears to be offline." ▿ exception : Optional<Error> - some : Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." ``` The NIO client has also been updated to return the `.unavailable` status code: ``` ▿ Optional<ConnectError> ▿ some : ConnectError - code : Connect.Code.unavailable ▿ message : Optional<String> - some : "client is not connected" - exception : nil ``` --------- Signed-off-by: Michael Rebello <[email protected]>
- Loading branch information