Skip to content

Commit

Permalink
cleaner implementation of failedUrl error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mythodeia committed Sep 16, 2015
1 parent 14842f6 commit 60cab8b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions SDWebImage/SDWebImageManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,13 @@ - (void)diskImageExistsForURL:(NSURL *)url
}
});

BOOL shouldBeFailedURLAlliOSVersion = (error.code != NSURLErrorNotConnectedToInternet && error.code != NSURLErrorCancelled && error.code != NSURLErrorTimedOut);
BOOL shouldBeFailedURLiOS7 = (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1 && error.code != NSURLErrorInternationalRoamingOff && error.code != NSURLErrorCallIsActive && error.code != NSURLErrorDataNotAllowed);
if (shouldBeFailedURLAlliOSVersion || shouldBeFailedURLiOS7) {
if ( error.code != NSURLErrorNotConnectedToInternet
&& error.code != NSURLErrorCancelled
&& error.code != NSURLErrorTimedOut
&& error.code != NSURLErrorInternationalRoamingOff
&& error.code != NSURLErrorDataNotAllowed
&& error.code != NSURLErrorCannotFindHost
&& error.code != NSURLErrorCannotConnectToHost) {
@synchronized (self.failedURLs) {
[self.failedURLs addObject:url];
}
Expand Down

0 comments on commit 60cab8b

Please sign in to comment.