MINOR: Improve error message for invalid topic in TopicCommand (#18714)

Reviewers: Divij Vaidya <diviv@amazon.com>
This commit is contained in:
yx9o 2025-01-30 19:07:45 +08:00 committed by GitHub
parent 95abd174c7
commit c0b5d3334a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -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()));
}
}