From 84e9756b83bea600a8000bb596165b624bdcde15 Mon Sep 17 00:00:00 2001 From: John Knox Date: Wed, 25 Mar 2020 17:35:28 -0700 Subject: [PATCH] Catch Error, not just Exceptions in ErrorReportingRunnable Summary: We can OOM in flipper, and we'd like to catch those and prevent them from crashing the app. They are Errors, not Exceptions. Reviewed By: mweststrate Differential Revision: D20648824 fbshipit-source-id: 60002a3c950518e56189776f05df8f2c92a851f0 --- .../java/com/facebook/flipper/core/ErrorReportingRunnable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/facebook/flipper/core/ErrorReportingRunnable.java b/android/src/main/java/com/facebook/flipper/core/ErrorReportingRunnable.java index 728ce8da4..f67e51f7d 100644 --- a/android/src/main/java/com/facebook/flipper/core/ErrorReportingRunnable.java +++ b/android/src/main/java/com/facebook/flipper/core/ErrorReportingRunnable.java @@ -22,7 +22,7 @@ public abstract class ErrorReportingRunnable implements Runnable { public final void run() { try { runOrThrow(); - } catch (Exception e) { + } catch (Throwable e) { if (mConnection != null) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw);