Fix the blacking error domain should filter specify SDWebImageErrorDomain codes which is indeed un-recoverable
This commit is contained in:
parent
b0f1006e3f
commit
8275274154
|
@ -178,7 +178,7 @@ static id<SDImageLoader> _defaultImageLoader;
|
||||||
|
|
||||||
// Query cache process
|
// Query cache process
|
||||||
- (void)callCacheProcessForOperation:(nonnull SDWebImageCombinedOperation *)operation
|
- (void)callCacheProcessForOperation:(nonnull SDWebImageCombinedOperation *)operation
|
||||||
url:(nullable NSURL *)url
|
url:(nonnull NSURL *)url
|
||||||
options:(SDWebImageOptions)options
|
options:(SDWebImageOptions)options
|
||||||
context:(nullable SDWebImageContext *)context
|
context:(nullable SDWebImageContext *)context
|
||||||
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
progress:(nullable SDImageLoaderProgressBlock)progressBlock
|
||||||
|
@ -206,7 +206,7 @@ static id<SDImageLoader> _defaultImageLoader;
|
||||||
|
|
||||||
// Download process
|
// Download process
|
||||||
- (void)callDownloadProcessForOperation:(nonnull SDWebImageCombinedOperation *)operation
|
- (void)callDownloadProcessForOperation:(nonnull SDWebImageCombinedOperation *)operation
|
||||||
url:(nullable NSURL *)url
|
url:(nonnull NSURL *)url
|
||||||
options:(SDWebImageOptions)options
|
options:(SDWebImageOptions)options
|
||||||
context:(SDWebImageContext *)context
|
context:(SDWebImageContext *)context
|
||||||
cachedImage:(nullable UIImage *)cachedImage
|
cachedImage:(nullable UIImage *)cachedImage
|
||||||
|
@ -280,7 +280,7 @@ static id<SDImageLoader> _defaultImageLoader;
|
||||||
|
|
||||||
// Store cache process
|
// Store cache process
|
||||||
- (void)callStoreCacheProcessForOperation:(nonnull SDWebImageCombinedOperation *)operation
|
- (void)callStoreCacheProcessForOperation:(nonnull SDWebImageCombinedOperation *)operation
|
||||||
url:(nullable NSURL *)url
|
url:(nonnull NSURL *)url
|
||||||
options:(SDWebImageOptions)options
|
options:(SDWebImageOptions)options
|
||||||
context:(SDWebImageContext *)context
|
context:(SDWebImageContext *)context
|
||||||
downloadedImage:(nullable UIImage *)downloadedImage
|
downloadedImage:(nullable UIImage *)downloadedImage
|
||||||
|
@ -375,7 +375,10 @@ static id<SDImageLoader> _defaultImageLoader;
|
||||||
shouldBlockFailedURL = [self.delegate imageManager:self shouldBlockFailedURL:url withError:error];
|
shouldBlockFailedURL = [self.delegate imageManager:self shouldBlockFailedURL:url withError:error];
|
||||||
} else {
|
} else {
|
||||||
// Filter the error domain and check error codes
|
// Filter the error domain and check error codes
|
||||||
if ([error.domain isEqualToString:NSURLErrorDomain]) {
|
if ([error.domain isEqualToString:SDWebImageErrorDomain]) {
|
||||||
|
shouldBlockFailedURL = ( error.code == SDWebImageErrorInvalidURL
|
||||||
|
|| error.code == SDWebImageErrorBadImageData);
|
||||||
|
} else if ([error.domain isEqualToString:NSURLErrorDomain]) {
|
||||||
shouldBlockFailedURL = ( error.code != NSURLErrorNotConnectedToInternet
|
shouldBlockFailedURL = ( error.code != NSURLErrorNotConnectedToInternet
|
||||||
&& error.code != NSURLErrorCancelled
|
&& error.code != NSURLErrorCancelled
|
||||||
&& error.code != NSURLErrorTimedOut
|
&& error.code != NSURLErrorTimedOut
|
||||||
|
|
Loading…
Reference in New Issue