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:
Pieter De Baets
2015-11-10 04:29:39 -08:00
committed by facebook-github-bot-7
parent caf111eb23
commit a377f81b4e
3 changed files with 8 additions and 2 deletions

View File

@@ -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