diff --git a/React/Base/RCTAssert.m b/React/Base/RCTAssert.m index 345dae02158fb6..79db51973c46ec 100644 --- a/React/Base/RCTAssert.m +++ b/React/Base/RCTAssert.m @@ -131,7 +131,7 @@ void RCTFatal(NSError *error) #endif NSString *name = [NSString stringWithFormat:@"%@: %@", RCTFatalExceptionName, error.localizedDescription]; NSString *message = RCTFormatError(error.localizedDescription, error.userInfo[RCTJSStackTraceKey], 75); - [NSException raise:name format:@"%@", message]; + @throw [[NSException alloc] initWithName:name reason:message userInfo:nil]; #if DEBUG } @catch (NSException *e) {} #endif diff --git a/React/CxxModule/RCTNativeModule.mm b/React/CxxModule/RCTNativeModule.mm index 4fbe0a14128da0..25e62cb330c7f2 100644 --- a/React/CxxModule/RCTNativeModule.mm +++ b/React/CxxModule/RCTNativeModule.mm @@ -112,6 +112,8 @@ static MethodCallResult invokeInner(RCTBridge *bridge, RCTModuleData *moduleData exception, method.JSMethodName, moduleData.name, objcParams, exception.callStackSymbols]; RCTFatal(RCTErrorWithMessage(message)); } + + return folly::none; } }