Provide more info when image fails to load

Reviewed By: javache

Differential Revision: D4209311

fbshipit-source-id: 6ad8ea6b8e236ec5ad2a2313a69b8985f9a06c74
This commit is contained in:
Alex Kotliarskyi 2016-11-21 04:48:58 -08:00 коммит произвёл Facebook Github Bot
Родитель b74da13a75
Коммит d117f550a5
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -429,9 +429,11 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
NSInteger statusCode = ((NSHTTPURLResponse *)response).statusCode;
if (statusCode != 200) {
NSString *errorMessage = [NSString stringWithFormat:@"Failed to load %@", response.URL];
NSDictionary *userInfo = @{NSLocalizedDescriptionKey: errorMessage};
completionHandler([[NSError alloc] initWithDomain:NSURLErrorDomain
code:statusCode
userInfo:nil], nil, nil);
userInfo:userInfo], nil, nil);
return;
}