mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
Make RCTNativeModule::invokeInner explicitely return folly::none in case of error
Differential Revision: D6347967 fbshipit-source-id: 88788da321ca75d20b6c1a8e3d41642af7c6155e
This commit is contained in:
committed by
Facebook Github Bot
parent
d19d137cc1
commit
0ac5a5230c
@@ -131,7 +131,7 @@ void RCTFatal(NSError *error)
|
|||||||
#endif
|
#endif
|
||||||
NSString *name = [NSString stringWithFormat:@"%@: %@", RCTFatalExceptionName, error.localizedDescription];
|
NSString *name = [NSString stringWithFormat:@"%@: %@", RCTFatalExceptionName, error.localizedDescription];
|
||||||
NSString *message = RCTFormatError(error.localizedDescription, error.userInfo[RCTJSStackTraceKey], 75);
|
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
|
#if DEBUG
|
||||||
} @catch (NSException *e) {}
|
} @catch (NSException *e) {}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -112,6 +112,8 @@ static MethodCallResult invokeInner(RCTBridge *bridge, RCTModuleData *moduleData
|
|||||||
exception, method.JSMethodName, moduleData.name, objcParams, exception.callStackSymbols];
|
exception, method.JSMethodName, moduleData.name, objcParams, exception.callStackSymbols];
|
||||||
RCTFatal(RCTErrorWithMessage(message));
|
RCTFatal(RCTErrorWithMessage(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return folly::none;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user