Skip to content

Commit

Permalink
Added ability to jump to syntax errors from RedBox
Browse files Browse the repository at this point in the history
  • Loading branch information
frantic committed Jan 30, 2015
1 parent a15603d commit 41b0b58
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ReactKit/Base/RCTRootView.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ - (void)dealloc
- (void)bundleFinishedLoading:(NSError *)error
{
if (error != nil) {
[[RCTRedBox sharedInstance] showErrorMessage:error.localizedDescription withDetails:error.localizedFailureReason];
NSArray *stack = [[error userInfo] objectForKey:@"stack"];
if (stack) {
[[RCTRedBox sharedInstance] showErrorMessage:[error localizedDescription] withStack:stack];
} else {
[[RCTRedBox sharedInstance] showErrorMessage:[error localizedDescription] withDetails:[error localizedFailureReason]];
}
} else {

[_bridge.uiManager registerRootView:self];
Expand Down

0 comments on commit 41b0b58

Please sign in to comment.