Revert failed block processing logic

This commit is contained in:
zhongwuzw 2019-01-09 22:03:06 +08:00
parent 4a52cce18a
commit e71e58ea6d
1 changed files with 8 additions and 15 deletions

View File

@ -374,21 +374,14 @@ static id<SDImageLoader> _defaultImageLoader;
if ([self.delegate respondsToSelector:@selector(imageManager:shouldBlockFailedURL:withError:)]) {
shouldBlockFailedURL = [self.delegate imageManager:self shouldBlockFailedURL:url withError:error];
} else {
NSString *domain = error.domain;
NSInteger code = error.code;
if ([domain isEqualToString:NSURLErrorDomain]) {
shouldBlockFailedURL = ( code != NSURLErrorNotConnectedToInternet
&& code != NSURLErrorCancelled
&& code != NSURLErrorTimedOut
&& code != NSURLErrorInternationalRoamingOff
&& code != NSURLErrorDataNotAllowed
&& code != NSURLErrorCannotFindHost
&& code != NSURLErrorCannotConnectToHost
&& code != NSURLErrorNetworkConnectionLost);
} else {
// Custom loader, don't do extra error code check
shouldBlockFailedURL = NO;
}
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);
}
return shouldBlockFailedURL;