react-native-macos/React
BaihaoTian d31756bf01 improve (RCTJSErrorFromCodeMessageAndNSError)
Summary:
First of all,please forgive my poor english. LOL

When I use Promises  as callBack,

 I followed the guide to make a (RCTPromiseRejectBlock),in this RCTPromiseRejectBlock,

from the guide I should add a (NSString)code a (NSString)message and an (NSError) to a  RCTPromiseRejectBlock.

As what did guide said I just make a NSError with

```
 NSError *error=[NSError errorWithDomain:@"native stroage error" code:402 userInfo:@{@"data":key}];

```

As you can see, I want to transfer some data in this callback.But I just found the (userInfo) of NSError didn't composed to a  RCTPromiseRejectBlock.

So I check out the source code of RCTUtil ,I found this

```

// TODO: Can we just replace RCTMakeError with this function instead?
NSDictionary<NSString *, id> *RCTJSErrorFromCodeMessageAndNSError(NSString *code,
                                                                  NSString *message,
                                                                  NSError *__nullable error)
{
  NSString *errorMessage;
Closes https://github.com/facebook/react-native/pull/9519

Differential Revision: D3821334

Pulled By: javache

fbshipit-source-id: 0fa40dd93932af70123b8f8a20a5c7dc5afdd6ac
2016-09-06 06:13:49 -07:00
..
Base improve (RCTJSErrorFromCodeMessageAndNSError) 2016-09-06 06:13:49 -07:00
CSSLayout Fix sizing of absolutely positioned nodes inside overflow:hidden parent 2016-08-31 08:13:41 -07:00
Executors Remove last arg from RCTProfileEnd, make macro's function-like 2016-09-05 11:13:33 -07:00
Modules remove incorrect `__unused` modifier 2016-09-06 02:43:40 -07:00
Profiler Remove last arg from RCTProfileEnd, make macro's function-like 2016-09-05 11:13:33 -07:00
React.xcodeproj Fix some unsafe thread behavior 2016-09-01 19:58:58 -07:00
Views RefreshControl Position Bug 2016-09-04 01:43:38 -07:00