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:
Mike Grabowski 2016-03-11 02:54:15 -08:00 committed by Facebook Github Bot 4
parent c42fc61a2a
commit 2bb2522f1e
1 changed files with 2 additions and 1 deletions

View File

@ -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);
}