MINOR: Use KafkaException instead of RuntimeException in admin result classes - #23232
Open
regarmukesh3g wants to merge 1 commit into
Open
MINOR: Use KafkaException instead of RuntimeException in admin result classes#23232regarmukesh3g wants to merge 1 commit into
regarmukesh3g wants to merge 1 commit into
Conversation
… 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.
uros-b
approved these changes
Aug 21, 2026
Member
|
Thank you @regarmukesh3g! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When catching
InterruptedException | ExecutionExceptionin theKafkaFuture.allOf() path, these exceptions were wrapped in a bare
RuntimeException, losing the cause chain and exception type.This PR replaces
RuntimeException(e)withKafkaException(e)in 12admin result classes for consistency with
DescribeProducersResultwhich already uses
KafkaException.Files changed (12)
Validation
Diff
12 files changed, 24 insertions(+), 12 deletions(-)
Reviewers: Uros (github:uros-b)