315157973 commented on a change in pull request #9928:
URL: https://github.com/apache/pulsar/pull/9928#discussion_r602080288



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/AdminResource.java
##########
@@ -624,16 +621,18 @@ protected boolean isNamespaceReplicated(NamespaceName 
namespaceName) {
         try {
             String partitionedTopicPath = path(PARTITIONED_TOPIC_PATH_ZNODE,
                     namespaceName.toString(), topicDomain.value());
-            List<String> topics = 
namespaceResources().getChildren(partitionedTopicPath);
+            List<String> topics = 
namespaceResources().getStore().getChildren(partitionedTopicPath).get();
             partitionedTopics = topics.stream()
                     .map(s -> String.format("%s://%s/%s", topicDomain.value(), 
namespaceName.toString(), decode(s)))
                     .collect(Collectors.toList());
-        } catch (NotFoundException e) {
-            // NoNode means there are no partitioned topics in this domain for 
this namespace
         } catch (Exception e) {
-            log.error("[{}] Failed to get partitioned topic list for namespace 
{}", clientAppId(),
-                    namespaceName.toString(), e);
-            throw new RestException(e);
+            if (e instanceof ExecutionException && e.getCause() instanceof 
NotFoundException) {
+                // NoNode means there are no partitioned topics in this domain 
for this namespace
+            } else {
+                log.error("[{}] Failed to get partitioned topic list for 
namespace {}", clientAppId(),
+                        namespaceName.toString(), e);
+                throw new RestException(e);

Review comment:
       Would it be better, just a suggestion
   `throw new RestException(e instanceof ExecutionException ? e.getCause() : e)`




-- 
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:
[email protected]


Reply via email to