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