feat(failedURLs): add additional error codes that shouldn't be considered as a permanent failure

This commit is contained in:
stephane-fueled 2015-05-26 17:47:02 +01:00
parent 0e761f4aa7
commit 4499441661
1 changed files with 3 additions and 1 deletions

View File

@ -192,7 +192,9 @@
}
});
if (error.code != NSURLErrorNotConnectedToInternet && error.code != NSURLErrorCancelled && error.code != NSURLErrorTimedOut) {
BOOL shouldBeFailedURLAlliOSVersion = (error.code != NSURLErrorNotConnectedToInternet && error.code != NSURLErrorCancelled && error.code != NSURLErrorTimedOut);
BOOL shouldBeFailedURLiOS7 = (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1 && error.code != NSURLErrorInternationalRoamingOff && error.code != NSURLErrorCallIsActive && error.code != NSURLErrorDataNotAllowed);
if (shouldBeFailedURLAlliOSVersion && (NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_6_1 || shouldBeFailedURLiOS7)) {
@synchronized (self.failedURLs) {
[self.failedURLs addObject:url];
}