Skip to content

MINOR: Use KafkaException instead of RuntimeException in admin result classes - #23232

Open
regarmukesh3g wants to merge 1 commit into
apache:trunkfrom
regarmukesh3g:fix/admin-result-exception-type
Open

MINOR: Use KafkaException instead of RuntimeException in admin result classes#23232
regarmukesh3g wants to merge 1 commit into
apache:trunkfrom
regarmukesh3g:fix/admin-result-exception-type

Conversation

@regarmukesh3g

@regarmukesh3g regarmukesh3g commented Aug 21, 2026

Copy link
Copy Markdown

Description

When catching InterruptedException | ExecutionException in the
KafkaFuture.allOf() path, these exceptions were wrapped in a bare
RuntimeException, losing the cause chain and exception type.

This PR replaces RuntimeException(e) with KafkaException(e) in 12
admin result classes for consistency with DescribeProducersResult
which already uses KafkaException.

Files changed (12)

  • DescribeClassicGroupsResult.java
  • DescribeConfigsResult.java
  • DescribeConsumerGroupsResult.java
  • DescribeLogDirsResult.java
  • DescribeReplicaLogDirsResult.java
  • DescribeShareGroupsResult.java
  • DescribeStreamsGroupsResult.java
  • DescribeTopicsResult.java
  • DescribeTransactionsResult.java
  • ListConsumerGroupOffsetsResult.java
  • ListOffsetsResult.java
  • ListShareGroupOffsetsResult.java

Validation

  • Compiles cleanly
  • All 13 related unit tests pass
  • Spotless, checkstyle, SpotBugs pass

Diff

12 files changed, 24 insertions(+), 12 deletions(-)

Reviewers: Uros (github:uros-b)

… classes

When catching InterruptedException | ExecutionException in the
KafkaFuture.allOf() path, these exceptions were wrapped in a bare
RuntimeException, losing the cause chain and exception type.

This PR replaces RuntimeException(e) with KafkaException(e) in 12
admin result classes (DescribeClassicGroupsResult, DescribeConfigsResult,
DescribeConsumerGroupsResult, DescribeLogDirsResult,
DescribeReplicaLogDirsResult, DescribeShareGroupsResult,
DescribeStreamsGroupsResult, DescribeTopicsResult,
DescribeTransactionsResult, ListConsumerGroupOffsetsResult,
ListOffsetsResult, ListShareGroupOffsetsResult) for consistency with
DescribeProducersResult which already uses KafkaException.

This improves debugging by preserving the full exception type and
stack trace chain for users encountering admin API failures.
@github-actions github-actions Bot added triage PRs from the community clients small Small PRs labels Aug 21, 2026
@uros-b

uros-b commented Aug 21, 2026

Copy link
Copy Markdown
Member

Thank you @regarmukesh3g!

@github-actions github-actions Bot removed the triage PRs from the community label Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants