MINOR: rename exception `e` to `swallow` where appropriate (#19948)
CI / build (push) Waiting to run Details

I noticed that in commit

[a662bc56](a662bc5634),
renamed ignored exceptions `e` to `swallow`.

Here's a small patch to make that change consistent in other files:
AsyncKafkaConsumer.java, KafkaConsumerTest.java,
AsyncKafkaConsumerTest.java

Reviewers: Kirk True <kirk@kirktrue.pro>, Lan Ding <isDing_L@163.com>,
 Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
Abhiram98 2025-06-13 03:48:02 -06:00 committed by GitHub
parent 94807bcd15
commit 99e1e684ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -1899,7 +1899,7 @@ public class AsyncKafkaConsumer<K, V> implements ConsumerDelegate<K, V> {
private void sendFetches(Timer timer) { private void sendFetches(Timer timer) {
try { try {
applicationEventHandler.addAndGet(new CreateFetchRequestsEvent(calculateDeadlineMs(timer))); applicationEventHandler.addAndGet(new CreateFetchRequestsEvent(calculateDeadlineMs(timer)));
} catch (TimeoutException e) { } catch (TimeoutException swallow) {
// Can be ignored, per above comments. // Can be ignored, per above comments.
} }
} }
@ -2212,7 +2212,7 @@ public class AsyncKafkaConsumer<K, V> implements ConsumerDelegate<K, V> {
Timer pollInterval = time.timer(100L); Timer pollInterval = time.timer(100L);
return ConsumerUtils.getResult(future, pollInterval); return ConsumerUtils.getResult(future, pollInterval);
} }
} catch (TimeoutException e) { } catch (TimeoutException swallow) {
// Ignore this as we will retry the event until the timeout expires. // Ignore this as we will retry the event until the timeout expires.
} finally { } finally {
timer.update(); timer.update();

View File

@ -1977,7 +1977,7 @@ public class KafkaConsumerTest {
try { try {
newConsumer(groupProtocol, null, Optional.of(Boolean.TRUE)); newConsumer(groupProtocol, null, Optional.of(Boolean.TRUE));
fail("Expected an InvalidConfigurationException"); fail("Expected an InvalidConfigurationException");
} catch (InvalidConfigurationException e) { } catch (InvalidConfigurationException swallow) {
// OK, expected // OK, expected
} }
@ -2142,7 +2142,7 @@ public class KafkaConsumerTest {
future.get(100, TimeUnit.MILLISECONDS); future.get(100, TimeUnit.MILLISECONDS);
if (closeTimeoutMs != 0) if (closeTimeoutMs != 0)
fail("Close completed without waiting for commit or leave response"); fail("Close completed without waiting for commit or leave response");
} catch (TimeoutException e) { } catch (TimeoutException swallow) {
// Expected exception // Expected exception
} }

View File

@ -182,8 +182,8 @@ public class AsyncKafkaConsumerTest {
if (consumer != null) { if (consumer != null) {
try { try {
consumer.close(CloseOptions.timeout(Duration.ZERO)); consumer.close(CloseOptions.timeout(Duration.ZERO));
} catch (Exception e) { } catch (Exception swallow) {
// best effort to clean up after each test, but may throw (ex. if callbacks where // best effort to clean up after each test, but may throw (ex. if callbacks were
// throwing errors) // throwing errors)
} }
} }