Skip to content

Commit

Permalink
Output warning when stack trace is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperka committed Apr 18, 2017
1 parent ab17832 commit c01d9fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion React/Base/RCTJSCErrorHandling.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#import "RCTAssert.h"
#import "RCTJSStackFrame.h"
#import "RCTLog.h"

NSString *const RCTJSExceptionUnsymbolicatedStackTraceKey = @"RCTJSExceptionUnsymbolicatedStackTraceKey";

Expand All @@ -25,7 +26,9 @@
userInfo[NSLocalizedFailureReasonErrorKey] = exceptionMessage;
}
NSString *const stack = [exception[@"stack"] toString];
if ([stack length]) {
if ([@"undefined" isEqualToString:stack]) {
RCTLogWarn(@"Couldn't get stack trace for %@:%@", exception[@"sourceURL"], exception[@"line"]);
} else if ([stack length]) {
NSArray<RCTJSStackFrame *> *const unsymbolicatedFrames = [RCTJSStackFrame stackFramesWithLines:stack];
userInfo[RCTJSStackTraceKey] = unsymbolicatedFrames;
}
Expand Down

0 comments on commit c01d9fe

Please sign in to comment.