From e71e58ea6d935ee9326deacc7ab75c0f2a92d192 Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Wed, 9 Jan 2019 22:03:06 +0800 Subject: [PATCH] Revert failed block processing logic --- SDWebImage/SDWebImageManager.m | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/SDWebImage/SDWebImageManager.m b/SDWebImage/SDWebImageManager.m index ae309220..0a91d89d 100644 --- a/SDWebImage/SDWebImageManager.m +++ b/SDWebImage/SDWebImageManager.m @@ -374,21 +374,14 @@ static id _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;