mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-18 12:22:20 +08:00
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:
committed by
Facebook Github Bot 4
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user