Added ability to jump to syntax errors from RedBox

This commit is contained in:
Alex Kotliarskyi 2015-01-30 10:17:28 -08:00
parent a15603d8f1
commit 41b0b5831f
1 changed files with 6 additions and 1 deletions

View File

@ -90,7 +90,12 @@ NSString *const RCTRootViewReloadNotification = @"RCTRootViewReloadNotification"
- (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];