mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 21:46:07 +08:00
Fix check for rethrowing RCTFatal exceptions
Summary: I changed the format slightly of the exception being generated in RCTFatal, so we we're catching and rethrowing it, which left some useful information of the error stack. public Reviewed By: majak Differential Revision: D2631341 fb-gh-sync-id: feb4939f58014171a55cd74f20f57bcd6dfddc1e
This commit is contained in:
committed by
facebook-github-bot-7
parent
caf111eb23
commit
a377f81b4e
@@ -12,6 +12,7 @@
|
||||
|
||||
NSString *const RCTErrorDomain = @"RCTErrorDomain";
|
||||
NSString *const RCTJSStackTraceKey = @"RCTJSStackTraceKey";
|
||||
NSString *const RCTFatalExceptionName = @"RCTFatalException";
|
||||
|
||||
static NSString *const RCTAssertFunctionStack = @"RCTAssertFunctionStack";
|
||||
|
||||
@@ -128,7 +129,7 @@ void RCTFatal(NSError *error)
|
||||
@try {
|
||||
#endif
|
||||
NSString *message = RCTFormatError([error localizedDescription], error.userInfo[RCTJSStackTraceKey], 75);
|
||||
[NSException raise:@"RCTFatalException" format:@"%@", message];
|
||||
[NSException raise:RCTFatalExceptionName format:@"%@", message];
|
||||
#if DEBUG
|
||||
} @catch (NSException *e) {}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user