Post

Replies

Boosts

Views

Created

Random timed out error on app start
I am getting the following error randomly when launching the app on my device with the debugger on. Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2103, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <EDA8D402-B117-45D5-B113-AC1CF4866669>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(     "LocalDataTask <EDA8D402-B117-45D5-B113-AC1CF4866669>.<1>" ), NSLocalizedDescription=The request timed out., NSErrorFailingURLStringKey=https://www.apple.com/library/test/success.html, NSErrorFailingURLKey=https://www.apple.com/library/test/success.html, _kCFStreamErrorDomainKey=4} I also managed to reproduce it with this simple code. let sessionConfiguration = URLSessionConfiguration.default sessionConfiguration.requestCachePolicy = .reloadIgnoringCacheData sessionConfiguration.timeoutIntervalForRequest = 5.0 sessionConfiguration.timeoutIntervalForResource = 5.0 let session = URLSession(configuration: sessionConfiguration) let task = session.dataTask( with: URLRequest(url: .init(string: "https://www.apple.com/library/test/success.html")!)) { data, response, error in if let error = error { print(error) } } task.resume() What does this error code mean? _kCFStreamErrorCodeKey=-2103
1
0
1k
Nov ’22