Introduce JReactSoftExceptionLogger to log SoftExceptions from C++

Summary:
When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D30272694

fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546
This commit is contained in:
Ramanpreet Nara
2021-08-13 13:53:44 -07:00
committed by Facebook GitHub Bot
parent f93d95e079
commit b7fd68e611
3 changed files with 56 additions and 0 deletions
@@ -50,4 +50,11 @@ public class ReactSoftExceptionLogger {
FLog.e(category, "Unhandled SoftException", cause);
}
}
@DoNotStrip
// For use from within the C++ JReactSoftExceptionLogger
private static void logNoThrowSoftExceptionWithMessage(
final String category, final String message) {
logSoftException(category, new ReactNoCrashSoftException(message));
}
}