From 480fc28f0889ec93bdaa18d80f05bba8c5912125 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Fri, 15 May 2020 20:04:00 -0700 Subject: [PATCH] FabricUIManager should only swallow exceptions related to ViewCommands Summary: In the previous diff I made a few more things "Retryable" exceptions, where previously only strictly ViewCommand-related code would throw Retryable exceptions. This change is to prevent FabricUIManager from swallowing these exceptions if they happen outside of the context of ViewCommands. Changelog: [Internal] Fabric Reviewed By: mdvacca Differential Revision: D21607324 fbshipit-source-id: b3bad4694d2399db447a9117cc31169104b36de5 --- .../facebook/react/fabric/FabricUIManager.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java index d23cfcef3b1..13b1d78329b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java @@ -773,12 +773,16 @@ public class FabricUIManager implements UIManager, LifecycleEventListener { // exception but never crash in debug. // It's not clear that logging this is even useful, because these events are very // common, mundane, and there's not much we can do about them currently. - ReactSoftException.logSoftException( - TAG, - new ReactNoCrashSoftException( - "Caught exception executing retryable mounting layer instruction: " - + mountItem.toString(), - e)); + if (mountItem instanceof DispatchCommandMountItem) { + ReactSoftException.logSoftException( + TAG, + new ReactNoCrashSoftException( + "Caught exception executing retryable mounting layer instruction: " + + mountItem.toString(), + e)); + } else { + throw e; + } } } mBatchedExecutionTime += SystemClock.uptimeMillis() - batchedExecutionStartTime;