react-native/React
Neil Sarkar c144bbfb7e Allow serializing underlying NSError objects, closes #10506
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?

See https://github.com/facebook/react-native/issues/10506. A native `NSError` with `NSUnderlyingErrorKey` set causes a JSON stringify error from the websocket dispatcher if remote debugging is enabled.

**Test plan (required)**

I'm not familiar with the react native testing framework. Happy to add a test for this if someone can point me to where this part of the codebase is exercised :)

I did some spot checks with nil user dictionaries and nil underlying errors here. The case that this solves is testable using https://github.com/superseriouscompany/react-native-error-repro, specifically:

```objective-c
NSError *underlyingError = [NSError errorWithDomain:@"underlyingDomain" code:421 userInfo:nil];
NSError *err = [NSError errorWithDomain:@"domain" code:68 userInfo:@{@"NSUnderlyingError": underlyingError}];

reject(@"foo", @"bar", err);
```
Closes https://github.com/facebook/react-native/pull/10507

Differential Revision: D4080802

Pulled By: lacker

fbshipit-source-id: 93a41d9e9a710e406a6ccac214a5617271b4bede
2016-10-26 01:43:39 -07:00
..
Base Allow serializing underlying NSError objects, closes #10506 2016-10-26 01:43:39 -07:00
CSSLayout Don't preallocate child lists 2016-10-25 17:13:36 -07:00
Executors Add a default context name to RCTJSCExecutor 2016-10-14 11:43:43 -07:00
Modules Fix Alert memory leak 2016-10-25 17:28:49 -07:00
Profiler Apple TV support 1: existing Objective C code should compile for tvOS 2016-09-27 06:28:33 -07:00
React.xcodeproj Travis CI reliability fixes: preload package manager and increase tim… 2016-10-16 15:43:44 -07:00
Views Remove flex shorthand getter because it doesnt make a lot of sense 2016-10-24 03:44:22 -07:00