merlimat closed pull request #1646: Fix the exception output for admin commands
URL: https://github.com/apache/incubator-pulsar/pull/1646
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdBase.java 
b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdBase.java
index 4601c89c8c..bf8ce6c058 100644
--- a/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdBase.java
+++ b/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdBase.java
@@ -72,17 +72,9 @@ public boolean run(String[] args) {
                 System.err.println("Error connecting to: " + 
admin.getServiceUrl());
                 return false;
             } catch (PulsarAdminException e) {
-                if (e.getCause() instanceof WebApplicationException) {
-                    WebApplicationException wae = (WebApplicationException) 
e.getCause();
-                    System.err.println("Code: " + 
wae.getResponse().getStatus());
-                    System.err.println("Header: " + 
wae.getResponse().getHeaders());
-                    System.err.println("Location: " + 
wae.getResponse().getLocation());
-                    System.err.println("Reason: " + 
wae.getResponse().getEntity());
-                } else {
-                    System.err.println(e.getHttpError());
-                    System.err.println();
-                    System.err.println("Reason: " + e.getMessage());
-                }
+                System.err.println(e.getHttpError());
+                System.err.println();
+                System.err.println("Reason: " + e.getMessage());
                 return false;
             } catch (Exception e) {
                 System.err.println("Got exception: " + e.getMessage());


 

----------------------------------------------------------------
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