From 70d760af54fc9c491365ce5c1ca1217c79872809 Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Mon, 1 Apr 2019 11:03:04 +0800 Subject: [PATCH] Revert "Filter the error domain with NSURLErrorDomain before checking the URL Error Codes" This reverts commit 40abbd648d8f788ba385c2c090eeb6a596dffe7a. --- SDWebImage/SDWebImageManager.m | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/SDWebImage/SDWebImageManager.m b/SDWebImage/SDWebImageManager.m index 9168f2c0..c912fb5f 100644 --- a/SDWebImage/SDWebImageManager.m +++ b/SDWebImage/SDWebImageManager.m @@ -209,19 +209,14 @@ if ([self.delegate respondsToSelector:@selector(imageManager:shouldBlockFailedURL:withError:)]) { shouldBlockFailedURL = [self.delegate imageManager:self shouldBlockFailedURL:url withError:error]; } else { - // 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; - } + 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); } if (shouldBlockFailedURL) {