Skip to content

Commit 0ac5a52

Browse files
fromcelticparkfacebook-github-bot
authored andcommitted
Make RCTNativeModule::invokeInner explicitely return folly::none in case of error
Differential Revision: D6347967 fbshipit-source-id: 88788da321ca75d20b6c1a8e3d41642af7c6155e
1 parent d19d137 commit 0ac5a52

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

React/Base/RCTAssert.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void RCTFatal(NSError *error)
131131
#endif
132132
NSString *name = [NSString stringWithFormat:@"%@: %@", RCTFatalExceptionName, error.localizedDescription];
133133
NSString *message = RCTFormatError(error.localizedDescription, error.userInfo[RCTJSStackTraceKey], 75);
134-
[NSException raise:name format:@"%@", message];
134+
@throw [[NSException alloc] initWithName:name reason:message userInfo:nil];
135135
#if DEBUG
136136
} @catch (NSException *e) {}
137137
#endif

React/CxxModule/RCTNativeModule.mm

+2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ static MethodCallResult invokeInner(RCTBridge *bridge, RCTModuleData *moduleData
112112
exception, method.JSMethodName, moduleData.name, objcParams, exception.callStackSymbols];
113113
RCTFatal(RCTErrorWithMessage(message));
114114
}
115+
116+
return folly::none;
115117
}
116118

117119
}

0 commit comments

Comments
 (0)