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
This commit is contained in:
Pieter De Baets
2026-07-17 02:43:24 -07:00
committed by meta-codesync[bot]
parent b33de750b0
commit 2bc248c535
+1
View File
@@ -450,6 +450,7 @@ function runTest(): Array<TestCaseResult> {
NativeFantom.startJSSamplingProfiler();
} catch (e) {
console.error('Could not start JS sampling profiler', e);
throw e;
}
try {