File tree 1 file changed +9
-15
lines changed
1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -418,26 +418,20 @@ - (void)URLSession:(NSURLSession *)session task :(NSURLSessionTask *)task
418
418
else
419
419
{
420
420
NSInteger statusCode = ((NSHTTPURLResponse *)task.response ).statusCode ;
421
- std::vector<unsigned char > buf; // just a placeholder
422
- const char *orignalURL = [task.originalRequest.URL.absoluteString cStringUsingEncoding: NSUTF8StringEncoding];
423
- std::string errorMessage = " " ;
424
421
425
422
// Check for error status code
426
423
if (statusCode >= 400 )
427
424
{
428
- errorMessage = cocos2d::StringUtils::format (" Downloader: Failed to download %s with status code (%d)" , orignalURL, (int )statusCode);
429
- }
430
- // Unknown issue
431
- else
432
- {
433
- errorMessage = cocos2d::StringUtils::format (" Downloader: Failed to download %s with unknown error" , orignalURL);
425
+ std::vector<unsigned char > buf; // just a placeholder
426
+ const char *orignalURL = [task.originalRequest.URL.absoluteString cStringUsingEncoding: NSUTF8StringEncoding];
427
+ std::string errorMessage = cocos2d::StringUtils::format (" Downloader: Failed to download %s with status code (%d)" , orignalURL, (int )statusCode);
428
+
429
+ _outer->onTaskFinish (*[wrapper get ],
430
+ cocos2d::network::DownloadTask::ERROR_IMPL_INTERNAL,
431
+ 0 ,
432
+ errorMessage,
433
+ buf);
434
434
}
435
-
436
- _outer->onTaskFinish (*[wrapper get ],
437
- cocos2d::network::DownloadTask::ERROR_IMPL_INTERNAL,
438
- 0 ,
439
- errorMessage,
440
- buf);
441
435
}
442
436
}
443
437
[self .taskDict removeObjectForKey: task];
You can’t perform that action at this time.
0 commit comments