This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 21abb34  Provide meaningful error message in "pulsar-admin topics 
lookup" (#1679)
21abb34 is described below

commit 21abb34ed93b192fcc5a058488856720437964cb
Author: Matteo Merli <mme...@apache.org>
AuthorDate: Sat Apr 28 19:02:28 2018 -0700

    Provide meaningful error message in "pulsar-admin topics lookup" (#1679)
---
 .../org/apache/pulsar/broker/web/PulsarWebResource.java     |  4 ++--
 .../org/apache/pulsar/client/admin/internal/LookupImpl.java | 13 ++-----------
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java
 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java
index d560ffa..01dd7f9 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/PulsarWebResource.java
@@ -573,7 +573,7 @@ public abstract class PulsarWebResource {
                 Policies policies = policiesResult.get();
                 if (policies.replication_clusters.isEmpty()) {
                     String msg = String.format(
-                            "Global namespace does not have any clusters 
configured : local_cluster=%s ns=%s",
+                            "Namespace does not have any clusters configured : 
local_cluster=%s ns=%s",
                             localCluster, namespace.toString());
                     log.warn(msg);
                     validationFuture.completeExceptionally(new 
RestException(Status.PRECONDITION_FAILED, msg));
@@ -586,7 +586,7 @@ public abstract class PulsarWebResource {
                         return;
                     }
                     String msg = String.format(
-                            "Global namespace missing local cluster name in 
replication list : local_cluster=%s ns=%s repl_clusters=%s",
+                            "Namespace missing local cluster name in clusters 
list: local_cluster=%s ns=%s clusters=%s",
                             localCluster, namespace.toString(), 
policies.replication_clusters);
 
                     log.warn(msg);
diff --git 
a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/LookupImpl.java
 
b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/LookupImpl.java
index 6b3d047..b1588f1 100644
--- 
a/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/LookupImpl.java
+++ 
b/pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/internal/LookupImpl.java
@@ -18,7 +18,6 @@
  */
 package org.apache.pulsar.client.admin.internal;
 
-import javax.ws.rs.ClientErrorException;
 import javax.ws.rs.client.WebTarget;
 
 import org.apache.pulsar.client.admin.Lookup;
@@ -38,14 +37,6 @@ public class LookupImpl extends BaseResource implements 
Lookup {
         v2lookup = web.path("/lookup/v2");
     }
 
-    private PulsarAdminException getLookupApiException(WebTarget target, 
Exception e) {
-        if (e instanceof ClientErrorException) {
-            return new PulsarAdminException((ClientErrorException) e, 
e.getMessage() + " at " + target.getUri());
-        } else {
-            return getApiException(e);
-        }
-    }
-
     @Override
     public String lookupTopic(String topic) throws PulsarAdminException {
         TopicName topicName = TopicName.get(topic);
@@ -55,7 +46,7 @@ public class LookupImpl extends BaseResource implements 
Lookup {
         try {
             return doTopicLookup(target);
         } catch (Exception e) {
-            throw getLookupApiException(target, e);
+            throw getApiException(e);
         }
     }
 
@@ -68,7 +59,7 @@ public class LookupImpl extends BaseResource implements 
Lookup {
         try {
             return request(target).get(String.class);
         } catch (Exception e) {
-            throw getLookupApiException(target, e);
+            throw getApiException(e);
         }
     }
 

-- 
To stop receiving notification emails like this one, please contact
si...@apache.org.

Reply via email to