merlimat commented on a change in pull request #3111: Improve  user prompts on 
get topic reference
URL: https://github.com/apache/pulsar/pull/3111#discussion_r238386370
 
 

 ##########
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
 ##########
 @@ -1231,7 +1231,16 @@ protected OffloadProcessStatus 
internalOffloadStatus(boolean authoritative) {
      */
     private Topic getTopicReference(TopicName topicName) {
         return 
pulsar().getBrokerService().getTopicIfExists(topicName.toString()).join()
-                .orElseThrow(() -> new RestException(Status.NOT_FOUND, "Topic 
not found"));
+                .orElseThrow(() -> {
+                    if 
(topicName.getCompleteTopicName().contains(TopicName.PARTITIONED_TOPIC_SUFFIX)) 
{
+                        if 
(!internalGetPartitionedTopicList().contains(topicName.getPartitionedTopicName()))
 {
+                            return new RestException(Status.NOT_FOUND, 
"Partitioned Topic not found");
+                        } else if 
(!internalGetList().contains(topicName.getCompleteTopicName())) {
+                            return new RestException(Status.NOT_FOUND, 
"Internal topics have not been generated yet");
 
 Review comment:
   Maybe something like `Topic partitions were not yet created` ? (or similar)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to