|
@@ -196,15 +196,22 @@ |
|
@@ -196,15 +196,22 @@ |
196
|
// if we would call the completedBlock, there could be a race condition between this block and another completedBlock for the same object, so if this one is called second, we will overwrite the new data
|
196
|
// if we would call the completedBlock, there could be a race condition between this block and another completedBlock for the same object, so if this one is called second, we will overwrite the new data
|
197
|
} else if (error) {
|
197
|
} else if (error) {
|
198
|
[self callCompletionBlockForOperation:strongSubOperation completion:completedBlock error:error url:url];
|
198
|
[self callCompletionBlockForOperation:strongSubOperation completion:completedBlock error:error url:url];
|
199
|
-
|
|
|
200
|
- if ( error.code != NSURLErrorNotConnectedToInternet
|
|
|
201
|
- && error.code != NSURLErrorCancelled
|
|
|
202
|
- && error.code != NSURLErrorTimedOut
|
|
|
203
|
- && error.code != NSURLErrorInternationalRoamingOff
|
|
|
204
|
- && error.code != NSURLErrorDataNotAllowed
|
|
|
205
|
- && error.code != NSURLErrorCannotFindHost
|
|
|
206
|
- && error.code != NSURLErrorCannotConnectToHost
|
|
|
207
|
- && error.code != NSURLErrorNetworkConnectionLost) {
|
199
|
+ BOOL shouldBlockFailedURL;
|
|
|
200
|
+ // Check whether we should block failed url
|
|
|
201
|
+ if ([self.delegate respondsToSelector:@selector(imageManager:shouldBlockFailedURL:withError:)]) {
|
|
|
202
|
+ shouldBlockFailedURL = [self.delegate imageManager:self shouldBlockFailedURL:url withError:error];
|
|
|
203
|
+ } else {
|
|
|
204
|
+ shouldBlockFailedURL = ( error.code != NSURLErrorNotConnectedToInternet
|
|
|
205
|
+ && error.code != NSURLErrorCancelled
|
|
|
206
|
+ && error.code != NSURLErrorTimedOut
|
|
|
207
|
+ && error.code != NSURLErrorInternationalRoamingOff
|
|
|
208
|
+ && error.code != NSURLErrorDataNotAllowed
|
|
|
209
|
+ && error.code != NSURLErrorCannotFindHost
|
|
|
210
|
+ && error.code != NSURLErrorCannotConnectToHost
|
|
|
211
|
+ && error.code != NSURLErrorNetworkConnectionLost);
|
|
|
212
|
+ }
|
|
|
213
|
+
|
|
|
214
|
+ if (shouldBlockFailedURL) {
|
208
|
@synchronized (self.failedURLs) {
|
215
|
@synchronized (self.failedURLs) {
|
209
|
[self.failedURLs addObject:url];
|
216
|
[self.failedURLs addObject:url];
|
210
|
}
|
217
|
}
|