Remove unused exception parameter from hermes/unittests/API/CDPAgentTest.cpp (#53213)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53213

`-Wunused-exception-parameter` has identified an unused exception parameter. This diff removes it.

This:
```
try {
    ...
} catch (exception& e) {
    // no use of e
}
```
should instead be written as
```
} catch (exception&) {
```

If the code compiles, this is safe to land.

Reviewed By: dtolnay

Differential Revision: D79968851

fbshipit-source-id: 18f2e6861f099915b1aad6aba58217ba94eb10c8
This commit is contained in:
Richard Barnes
2025-08-11 09:35:31 -07:00
committed by Facebook GitHub Bot
parent 85b47afb48
commit 9eb90f8911
3 changed files with 3 additions and 3 deletions
@@ -200,7 +200,7 @@ void CxxNativeModule::invoke(
"CxxMethodCallDispatch", "module", moduleName, "method", method.name);
try {
method.func(params, first, second);
} catch (const facebook::xplat::JsArgumentException& ex) {
} catch (const facebook::xplat::JsArgumentException&) {
throw;
} catch (std::exception& e) {
LOG(ERROR) << "std::exception. Method call " << method.name.c_str()
@@ -31,7 +31,7 @@ TEST(RecoverableError, RunRethrowingAsRecoverableFallthroughTest) {
RecoverableError::runRethrowingAsRecoverable<std::runtime_error>(
[]() { throw std::logic_error("catch me"); });
FAIL() << "Unthrown exception";
} catch (const RecoverableError& err) {
} catch (const RecoverableError&) {
FAIL() << "Recovered exception that should have fallen through";
} catch (const std::exception& err) {
ASSERT_STREQ(err.what(), "catch me");
@@ -119,7 +119,7 @@ PerformanceEntryReporter::UserTimingDetailProvider getDetailProviderFromEntry(
try {
auto detail = entry.asObject(rt).getProperty(rt, "detail");
return jsi::dynamicFromValue(rt, detail);
} catch (jsi::JSIException& ex) {
} catch (jsi::JSIException&) {
return nullptr;
}
};