Provide more info when image fails to load
Reviewed By: javache Differential Revision: D4209311 fbshipit-source-id: 6ad8ea6b8e236ec5ad2a2313a69b8985f9a06c74
This commit is contained in:
parent
b74da13a75
commit
d117f550a5
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue