Skip to content

Commit d117f55

Browse files
franticFacebook Github Bot
authored andcommitted
Provide more info when image fails to load
Reviewed By: javache Differential Revision: D4209311 fbshipit-source-id: 6ad8ea6b8e236ec5ad2a2313a69b8985f9a06c74
1 parent b74da13 commit d117f55

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Libraries/Image/RCTImageLoader.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,11 @@ - (RCTImageLoaderCancellationBlock)_loadURLRequest:(NSURLRequest *)request
429429
if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
430430
NSInteger statusCode = ((NSHTTPURLResponse *)response).statusCode;
431431
if (statusCode != 200) {
432+
NSString *errorMessage = [NSString stringWithFormat:@"Failed to load %@", response.URL];
433+
NSDictionary *userInfo = @{NSLocalizedDescriptionKey: errorMessage};
432434
completionHandler([[NSError alloc] initWithDomain:NSURLErrorDomain
433435
code:statusCode
434-
userInfo:nil], nil, nil);
436+
userInfo:userInfo], nil, nil);
435437
return;
436438
}
437439

0 commit comments

Comments
 (0)