Skip to content

Commit

Permalink
Remove unused exception parameter from xplat/hermes/API/hermes/cdp/Ru…
Browse files Browse the repository at this point in the history
…ntimeDomainAgent.cpp

Summary:
`-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: dmm-fb

Differential Revision: D60516147

fbshipit-source-id: 06d0d97ab0deb6ef8640a3f7ebebdf5e93ef9fe8
  • Loading branch information
r-barnes authored and facebook-github-bot committed Aug 2, 2024
1 parent 937cde7 commit de90d05
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions API/hermes/cdp/RuntimeDomainAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ void RuntimeDomainAgent::callFunctionOn(
evalResult = runtime_.evaluateJavaScript(
std::unique_ptr<jsi::StringBuffer>(new jsi::StringBuffer(expression)),
kEvaluatedCodeUrl);
} catch (const jsi::JSIException &error) {
} catch (const jsi::JSIException &) {
sendResponseToClient(m::makeErrorResponse(
req.id,
m::ErrorCode::InternalError,
Expand Down Expand Up @@ -883,7 +883,7 @@ RuntimeDomainAgent::makePropsFromValue(
desc.wasThrown = true;
desc.value = m::runtime::makeRemoteObjectForError(
runtime, err.value(), *objTable_, objectGroup);
} catch (const jsi::JSIException &err) {
} catch (const jsi::JSIException &) {
desc.wasThrown = true;
desc.value = m::runtime::makeRemoteObject(
runtime,
Expand Down
2 changes: 1 addition & 1 deletion API/hermes/inspector/chrome/CDPHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,7 @@ std::vector<m::runtime::PropertyDescriptor> CDPHandlerImpl::makePropsFromValue(
jsi::Value propValue = obj.getProperty(runtime, propName);
desc.value = m::runtime::makeRemoteObject(
runtime, propValue, objTable_, objectGroup, false, generatePreview);
} catch (const jsi::JSError &err) {
} catch (const jsi::JSError &) {
// We fetched a property with a getter that threw. Show a placeholder.
// We could have added additional info, but the UI quickly gets messy.
desc.value = m::runtime::makeRemoteObject(
Expand Down
4 changes: 2 additions & 2 deletions API/hermes/inspector/chrome/RemoteObjectConverters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static m::runtime::ObjectPreview generateArrayPreview(
try {
desc = generatePropertyPreview(
runtime, indexString, obj.getValueAtIndex(runtime, i));
} catch (const jsi::JSError &err) {
} catch (const jsi::JSError &) {
desc.name = indexString;
desc.type = "string";
desc.value = "<Exception>";
Expand Down Expand Up @@ -121,7 +121,7 @@ static m::runtime::ObjectPreview generateObjectPreview(
// Chrome instead detects getters and makes you click to invoke.
desc = generatePropertyPreview(
runtime, propName.utf8(runtime), obj.getProperty(runtime, propName));
} catch (const jsi::JSError &err) {
} catch (const jsi::JSError &) {
desc.name = propName.utf8(runtime);
desc.type = "string";
desc.value = "<Exception>";
Expand Down
2 changes: 1 addition & 1 deletion API/hermes/inspector/chrome/tests/ConnectionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2793,7 +2793,7 @@ TEST_F(ConnectionTests, testConsoleBuffer) {
EXPECT_EQ(note.type, "log");
EXPECT_EQ(note.args.size(), 1);
received[nthLog % kExpectedMaxBufferSize] = true;
} catch (const std::exception &e) {
} catch (const std::exception &) {
EXPECT_EQ(note.type, "warning");
EXPECT_EQ(note.args.size(), 1);
EXPECT_NE((*note.args[0].value).find("discarded"), std::string::npos);
Expand Down

0 comments on commit de90d05

Please sign in to comment.