Skip to content

Commit

Permalink
Error handling for concrete JS executor
Browse files Browse the repository at this point in the history
Reviewed By: adamjernst

Differential Revision: D3235189

fb-gh-sync-id: a6d545a6b0b388c52305e2936371776d579460cd
fbshipit-source-id: a6d545a6b0b388c52305e2936371776d579460cd
  • Loading branch information
javache authored and Facebook Github Bot 9 committed Apr 28, 2016
1 parent 41e89b4 commit 26d0ce9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions React/Executors/RCTJSCExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ RCT_EXTERN NSString *const RCTJSCThreadName;
*/
RCT_EXTERN NSString *const RCTJavaScriptContextCreatedNotification;

/**
* Create a NSError from a JSError object.
*
* If available, the error's userInfo property will contain the JS stacktrace under
* the RCTJSStackTraceKey key.
*/
RCT_EXTERN NSError *RCTNSErrorFromJSError(JSContextRef context, JSValueRef jsError);

/**
* Uses a JavaScriptCore context as the execution engine.
*/
Expand Down
2 changes: 1 addition & 1 deletion React/Executors/RCTJSCExecutor.mm
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ @implementation RCTJSCExecutor
return (__bridge_transfer NSString *)string;
}

static NSError *RCTNSErrorFromJSError(JSContextRef context, JSValueRef jsError)
NSError *RCTNSErrorFromJSError(JSContextRef context, JSValueRef jsError)
{
NSMutableDictionary *errorInfo = [NSMutableDictionary new];

Expand Down

0 comments on commit 26d0ce9

Please sign in to comment.