From 2bc248c535d8ae35eb8a2c27a606bbff13e7b2d3 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 17 Jul 2026 02:43:24 -0700 Subject: [PATCH] Propage startJSSamplingProfiler error (#57587) Summary: Pull Request resolved: https://github.com/react/react-native/pull/57587 Adds rethrow in catch blocks when `startJSSamplingProfiler()` fails, preventing the `finally` block from attempting to stop a profiler that was never started. Changelog: [Internal] Reviewed By: thegreatercurve Differential Revision: D112405579 fbshipit-source-id: 4b1cc6746d8ba29df99be57e583ee06ac742c12c --- private/react-native-fantom/runtime/setup.js | 1 + 1 file changed, 1 insertion(+) diff --git a/private/react-native-fantom/runtime/setup.js b/private/react-native-fantom/runtime/setup.js index 7a5c198aa3c..e148564868c 100644 --- a/private/react-native-fantom/runtime/setup.js +++ b/private/react-native-fantom/runtime/setup.js @@ -450,6 +450,7 @@ function runTest(): Array { NativeFantom.startJSSamplingProfiler(); } catch (e) { console.error('Could not start JS sampling profiler', e); + throw e; } try {