Users of an app I took over recently are reporting network error alerts like those:
Network error (-1009)
Network error (-1001)
Network error (-1005)
Network error (2)
(Fejl is Danish for Error)
The error are: NSURLErrorTimedOut
, NSURLErrorNetworkConnectionLost
, NSURLErrorNotConnectedToInternet
, so mostly about bad/lost connection to the server.
AFNetworking 3.0
is used.
In the request headers we find Connection: close
and the timeout is set to 15 seconds request.timeoutInterval = 30
First, I couldn't find showing an alert anywhere in the source code, so I would like to know if the displayed alerts on network errors are handled by iOS?
Then, I am looking for a way to simulate those errors. I tried with the Network Link Conditioner on a device but didn't get any of those errors.
The errors and their respective error codes are listed here: https://developer.apple.com/reference/foundation/1508628-url_loading_system_error_codes?language=objc