Skip to content

Commit

Permalink
Remove unused exception parameter from velox/common/base/tests/AsyncS…
Browse files Browse the repository at this point in the history
…ourceTest.cpp (#9910)

Summary:
Pull Request resolved: #9910

`-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: palmje, mbasmanova

Differential Revision: D57636920

fbshipit-source-id: 8861d0269a24d57b421f03c111f09de5fefc3422
  • Loading branch information
r-barnes authored and facebook-github-bot committed May 23, 2024
1 parent 5204da9 commit 5eeb3f9
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion velox/common/base/tests/AsyncSourceTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ TEST(AsyncSourceTest, errorsWithThreads) {
auto gizmo =
gizmos[folly::Random::rand32(rng) % gizmos.size()]->move();
EXPECT_EQ(nullptr, gizmo);
} catch (std::exception& e) {
} catch (std::exception&) {
++numErrors;
}
}
Expand Down
2 changes: 1 addition & 1 deletion velox/common/memory/SharedArbitrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ uint64_t SharedArbitrator::growCapacity(
decrementFreeCapacityLocked(maxBytesToReserve, minBytesToReserve);
try {
checkedGrow(pool, reservedBytes, 0);
} catch (const VeloxRuntimeError& error) {
} catch (const VeloxRuntimeError&) {
reservedBytes = 0;
}
return reservedBytes;
Expand Down
2 changes: 1 addition & 1 deletion velox/common/memory/tests/MemoryAllocatorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class MemoryAllocatorTest : public testing::TestWithParam<int> {
EXPECT_TRUE(result.empty());
return false;
}
} catch (const VeloxException& e) {
} catch (const VeloxException&) {
EXPECT_TRUE(result.empty());
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion velox/common/memory/tests/MemoryPoolTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class MemoryPoolTest : public testing::TestWithParam<TestParam> {
void abortPool(MemoryPool* pool) {
try {
VELOX_FAIL("Manual MemoryPool Abortion");
} catch (const VeloxException& error) {
} catch (const VeloxException&) {
pool->abort(std::current_exception());
}
}
Expand Down
2 changes: 1 addition & 1 deletion velox/exec/fuzzer/RowNumberFuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ void RowNumberFuzzer::verify() {
VELOX_CHECK(
assertEqualResults({expected}, {actual}),
"Logically equivalent plans produced different results");
} catch (const VeloxException& e) {
} catch (const VeloxException&) {
LOG(ERROR) << "Expected\n"
<< expected->toString(0, expected->size()) << "\nActual\n"
<< actual->toString(0, actual->size());
Expand Down
6 changes: 3 additions & 3 deletions velox/exec/tests/TaskTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ DEBUG_ONLY_TEST_F(TaskTest, driverCounters) {
try {
while (cursor->moveNext()) {
};
} catch (VeloxRuntimeError& ex) {
} catch (VeloxRuntimeError&) {
}
});

Expand Down Expand Up @@ -1763,7 +1763,7 @@ DEBUG_ONLY_TEST_F(

try {
VELOX_FAIL(abortErrorMessage);
} catch (VeloxException& e) {
} catch (VeloxException&) {
abortWait.await([&]() { return abortWaitFlag.load(); });
blockingTask->pool()->abort(std::current_exception());
}
Expand Down Expand Up @@ -1818,7 +1818,7 @@ DEBUG_ONLY_TEST_F(TaskTest, longRunningOperatorInTaskReclaimerAbort) {
const std::string abortErrorMessage("Synthetic Exception");
try {
VELOX_FAIL(abortErrorMessage);
} catch (VeloxException& e) {
} catch (VeloxException&) {
blockingTask->pool()->abort(std::current_exception());
}
waitForTaskCompletion(blockingTask.get());
Expand Down
2 changes: 1 addition & 1 deletion velox/functions/sparksql/MakeTimestamp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class MakeTimestampFunction : public exec::VectorFunction {
int64_t constantTzID;
try {
constantTzID = util::getTimeZoneID(std::string_view(tz));
} catch (const VeloxException& e) {
} catch (const VeloxException&) {
context.setErrors(rows, std::current_exception());
return;
}
Expand Down

0 comments on commit 5eeb3f9

Please sign in to comment.