Don't lose NSError code in RCTJSErrorFromNSError()
Summary:Fixes #6171
Send original error code back to JS - this reverts old functionality according to https://github.com/facebook/react-native/issues/6171#issuecomment-189332649, that is 3c541ca540/React/Base/RCTUtils.m (L299)
Closes https://github.com/facebook/react-native/pull/6201
Differential Revision: D2988618
Pulled By: javache
fb-gh-sync-id: 85a280b76e557bffc4d952ed7f39eeb8a88b66ba
shipit-source-id: 85a280b76e557bffc4d952ed7f39eeb8a88b66ba
This commit is contained in:
parent
c42fc61a2a
commit
2bb2522f1e
|
@ -372,7 +372,8 @@ NSDictionary<NSString *, id> *RCTMakeAndLogError(NSString *message,
|
|||
|
||||
NSDictionary<NSString *, id> *RCTJSErrorFromNSError(NSError *error)
|
||||
{
|
||||
return RCTJSErrorFromCodeMessageAndNSError(RCTErrorUnspecified,
|
||||
NSString *codeWithDomain = [NSString stringWithFormat:@"E%@%zd", error.domain.uppercaseString, error.code];
|
||||
return RCTJSErrorFromCodeMessageAndNSError(codeWithDomain,
|
||||
error.localizedDescription,
|
||||
error);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue