cleaner implementation of failedUrl error handling
This commit is contained in:
parent
14842f65f7
commit
60cab8b74c
|
@ -192,9 +192,13 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
BOOL shouldBeFailedURLAlliOSVersion = (error.code != NSURLErrorNotConnectedToInternet && error.code != NSURLErrorCancelled && error.code != NSURLErrorTimedOut);
|
if ( error.code != NSURLErrorNotConnectedToInternet
|
||||||
BOOL shouldBeFailedURLiOS7 = (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1 && error.code != NSURLErrorInternationalRoamingOff && error.code != NSURLErrorCallIsActive && error.code != NSURLErrorDataNotAllowed);
|
&& error.code != NSURLErrorCancelled
|
||||||
if (shouldBeFailedURLAlliOSVersion || shouldBeFailedURLiOS7) {
|
&& error.code != NSURLErrorTimedOut
|
||||||
|
&& error.code != NSURLErrorInternationalRoamingOff
|
||||||
|
&& error.code != NSURLErrorDataNotAllowed
|
||||||
|
&& error.code != NSURLErrorCannotFindHost
|
||||||
|
&& error.code != NSURLErrorCannotConnectToHost) {
|
||||||
@synchronized (self.failedURLs) {
|
@synchronized (self.failedURLs) {
|
||||||
[self.failedURLs addObject:url];
|
[self.failedURLs addObject:url];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue