From 41b0b5831fedcaa0605233af54185750d12cde52 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Fri, 30 Jan 2015 10:17:28 -0800 Subject: [PATCH] Added ability to jump to syntax errors from RedBox --- ReactKit/Base/RCTRootView.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ReactKit/Base/RCTRootView.m b/ReactKit/Base/RCTRootView.m index 7606c3df2..bfe2466f1 100644 --- a/ReactKit/Base/RCTRootView.m +++ b/ReactKit/Base/RCTRootView.m @@ -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];