Skip to content

Commit 41b0b58

Browse files
committed
Added ability to jump to syntax errors from RedBox
1 parent a15603d commit 41b0b58

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ReactKit/Base/RCTRootView.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ - (void)dealloc
9090
- (void)bundleFinishedLoading:(NSError *)error
9191
{
9292
if (error != nil) {
93-
[[RCTRedBox sharedInstance] showErrorMessage:error.localizedDescription withDetails:error.localizedFailureReason];
93+
NSArray *stack = [[error userInfo] objectForKey:@"stack"];
94+
if (stack) {
95+
[[RCTRedBox sharedInstance] showErrorMessage:[error localizedDescription] withStack:stack];
96+
} else {
97+
[[RCTRedBox sharedInstance] showErrorMessage:[error localizedDescription] withDetails:[error localizedFailureReason]];
98+
}
9499
} else {
95100

96101
[_bridge.uiManager registerRootView:self];

0 commit comments

Comments
 (0)