Skip to content

Commit

Permalink
Using exception reason as error response
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongwuzw committed Dec 8, 2023
1 parent f219904 commit 4b6ccaa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-native/Libraries/Network/RCTNetworkTask.mm
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ - (void)URLRequest:(id)requestToken didReceiveData:(NSData *)data
if (_completionBlock) {
RCTURLRequestCompletionBlock completionBlock = _completionBlock;
[self dispatchCallback:^{
completionBlock(self->_response, nil, RCTErrorWithMessage(@"Request's received data too long."));
completionBlock(
self->_response, nil, RCTErrorWithMessage(exception.reason ?: @"Request's received data too long."));
}];
}
[self invalidate];
Expand Down

0 comments on commit 4b6ccaa

Please sign in to comment.