diff --git a/React/Base/RCTAssert.m b/React/Base/RCTAssert.m index 03e40c930..4742cb381 100644 --- a/React/Base/RCTAssert.m +++ b/React/Base/RCTAssert.m @@ -128,8 +128,9 @@ void RCTFatal(NSError *error) #if DEBUG @try { #endif + NSString *name = [NSString stringWithFormat:@"%@: %@", RCTFatalExceptionName, [error localizedDescription]]; NSString *message = RCTFormatError([error localizedDescription], error.userInfo[RCTJSStackTraceKey], 75); - [NSException raise:RCTFatalExceptionName format:@"%@", message]; + [NSException raise:name format:@"%@", message]; #if DEBUG } @catch (NSException *e) {} #endif @@ -160,5 +161,5 @@ NSString *RCTFormatError(NSString *message, NSArray } } - return [NSString stringWithFormat:@"Message: %@%@", message, prettyStack]; + return [NSString stringWithFormat:@"%@%@", message, prettyStack]; } diff --git a/React/Base/RCTBatchedBridge.m b/React/Base/RCTBatchedBridge.m index 66f1f737d..26dcb5772 100644 --- a/React/Base/RCTBatchedBridge.m +++ b/React/Base/RCTBatchedBridge.m @@ -780,7 +780,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR } @catch (NSException *exception) { // Pass on JS exceptions - if ([exception.name isEqualToString:RCTFatalExceptionName]) { + if ([exception.name hasPrefix:RCTFatalExceptionName]) { @throw exception; }