Filter the error domain with NSURLErrorDomain before checking the URL Error Codes
This commit is contained in:
parent
f023c9bb6c
commit
40abbd648d
|
@ -209,14 +209,19 @@
|
|||
if ([self.delegate respondsToSelector:@selector(imageManager:shouldBlockFailedURL:withError:)]) {
|
||||
shouldBlockFailedURL = [self.delegate imageManager:self shouldBlockFailedURL:url withError:error];
|
||||
} else {
|
||||
shouldBlockFailedURL = ( error.code != NSURLErrorNotConnectedToInternet
|
||||
&& error.code != NSURLErrorCancelled
|
||||
&& error.code != NSURLErrorTimedOut
|
||||
&& error.code != NSURLErrorInternationalRoamingOff
|
||||
&& error.code != NSURLErrorDataNotAllowed
|
||||
&& error.code != NSURLErrorCannotFindHost
|
||||
&& error.code != NSURLErrorCannotConnectToHost
|
||||
&& error.code != NSURLErrorNetworkConnectionLost);
|
||||
// Filter the error domain and check error codes
|
||||
if ([error.domain isEqualToString:NSURLErrorDomain]) {
|
||||
shouldBlockFailedURL = ( error.code != NSURLErrorNotConnectedToInternet
|
||||
&& error.code != NSURLErrorCancelled
|
||||
&& error.code != NSURLErrorTimedOut
|
||||
&& error.code != NSURLErrorInternationalRoamingOff
|
||||
&& error.code != NSURLErrorDataNotAllowed
|
||||
&& error.code != NSURLErrorCannotFindHost
|
||||
&& error.code != NSURLErrorCannotConnectToHost
|
||||
&& error.code != NSURLErrorNetworkConnectionLost);
|
||||
} else {
|
||||
shouldBlockFailedURL = NO;
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldBlockFailedURL) {
|
||||
|
|
Loading…
Reference in New Issue