Make RCTNativeModule::invokeInner explicitely return folly::none in case of error

Differential Revision: D6347967

fbshipit-source-id: 88788da321ca75d20b6c1a8e3d41642af7c6155e
This commit is contained in:
Alex Dvornikov 2017-11-17 03:12:59 -08:00 committed by Facebook Github Bot
parent d19d137cc1
commit 0ac5a5230c
2 changed files with 3 additions and 1 deletions

View File

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

View File

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