Skip to content

Commit

Permalink
feat(failedURLs): add additional error codes that shouldn't be consid…
Browse files Browse the repository at this point in the history
…ered as a permanent failure
  • Loading branch information
stephanecopin committed Jun 24, 2015
1 parent 0e761f4 commit 4499441
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SDWebImage/SDWebImageManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ - (void)diskImageExistsForURL:(NSURL *)url
}
});

if (error.code != NSURLErrorNotConnectedToInternet && error.code != NSURLErrorCancelled && error.code != NSURLErrorTimedOut) {
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 && (NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_6_1 || shouldBeFailedURLiOS7)) {
@synchronized (self.failedURLs) {
[self.failedURLs addObject:url];
}
Expand Down

0 comments on commit 4499441

Please sign in to comment.