Capture StackOverflowExceptions triggered when drawing a ReactViewGroup or ReactRootView

Reviewed By: achen1

Differential Revision: D6653395

fbshipit-source-id: 849b1a2ed6ab9bc057414d451e97a673178c30dd
This commit is contained in:
David Vacca
2018-01-18 18:45:54 -08:00
committed by Facebook Github Bot
parent 877f1cde2e
commit 1aac962378
6 changed files with 105 additions and 48 deletions

View File

@@ -304,13 +304,13 @@ public class ReactContext extends ContextWrapper {
* {@link com.facebook.react.bridge.NativeModuleCallExceptionHandler} if one exists, rethrowing
* otherwise.
*/
public void handleException(RuntimeException e) {
public void handleException(Exception e) {
if (mCatalystInstance != null &&
!mCatalystInstance.isDestroyed() &&
mNativeModuleCallExceptionHandler != null) {
mNativeModuleCallExceptionHandler.handleException(e);
} else {
throw e;
throw new RuntimeException(e);
}
}