You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/02/17 12:39:18 UTC

[GitHub] [kafka] chia7712 commented on a change in pull request #10141: KAFKA-12329; kafka-reassign-partitions command should give a better error message when a topic does not exist

chia7712 commented on a change in pull request #10141:
URL: https://github.com/apache/kafka/pull/10141#discussion_r577570241



##########
File path: clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java
##########
@@ -1887,7 +1887,11 @@ void handleResponse(AbstractResponse abstractResponse) {
                     KafkaFutureImpl<TopicDescription> future = entry.getValue();
                     Errors topicError = errors.get(topicName);
                     if (topicError != null) {
-                        future.completeExceptionally(topicError.exception());
+                        if (topicError == Errors.UNKNOWN_TOPIC_OR_PARTITION) {
+                            future.completeExceptionally(new UnknownTopicOrPartitionException("Topic " + topicName + " not found."));

Review comment:
       How about using `topicError.exception("Topic " + topicName + " not found.")`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org