Skip to content

Commit

Permalink
Don't lose NSError code in RCTJSErrorFromNSError()
Browse files Browse the repository at this point in the history
Summary:Fixes facebook#6171

Send original error code back to JS - this reverts old functionality according to facebook#6171 (comment), that is https://github.com/facebook/react-native/blob/3c541ca54095fbf9d572362bcb661593acc1b64b/React/Base/RCTUtils.m#L299
Closes facebook#6201

Differential Revision: D2988618

Pulled By: javache

fb-gh-sync-id: 85a280b76e557bffc4d952ed7f39eeb8a88b66ba
shipit-source-id: 85a280b76e557bffc4d952ed7f39eeb8a88b66ba
  • Loading branch information
grabbou authored and Facebook Github Bot 4 committed Mar 11, 2016
1 parent c42fc61 commit 2bb2522
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion React/Base/RCTUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ BOOL RCTClassOverridesInstanceMethod(Class cls, SEL selector)

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);
}
Expand Down

0 comments on commit 2bb2522

Please sign in to comment.