This is an automated email from the ASF dual-hosted git repository.
divijv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new c0b5d3334ad MINOR: Improve error message for invalid topic in
TopicCommand (#18714)
c0b5d3334ad is described below
commit c0b5d3334ad18eb98c69695fb2256e784a121821
Author: yx9o <[email protected]>
AuthorDate: Thu Jan 30 19:07:45 2025 +0800
MINOR: Improve error message for invalid topic in TopicCommand (#18714)
Reviewers: Divij Vaidya <[email protected]>
---
tools/src/main/java/org/apache/kafka/tools/TopicCommand.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/src/main/java/org/apache/kafka/tools/TopicCommand.java
b/tools/src/main/java/org/apache/kafka/tools/TopicCommand.java
index e5171057c6c..32272d4e926 100644
--- a/tools/src/main/java/org/apache/kafka/tools/TopicCommand.java
+++ b/tools/src/main/java/org/apache/kafka/tools/TopicCommand.java
@@ -210,7 +210,7 @@ public abstract class TopicCommand {
// If no topic name was mentioned, do not need to throw exception.
if (requestedTopic.isPresent() && !requestedTopic.get().isEmpty() &&
requireTopicExists && foundTopics.isEmpty()) {
// If given topic doesn't exist then throw exception
- throw new IllegalArgumentException(String.format("Topic '%s' does
not exist as expected", requestedTopic));
+ throw new IllegalArgumentException(String.format("Topic '%s' does
not exist as expected", requestedTopic.get()));
}
}