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

xiangfu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 0927e94b0d [Quickstart] Improve error message and remove 
NullPointerException when connection fails (#10293)
0927e94b0d is described below

commit 0927e94b0dce761fe65ea0a47c5e2d8a0887ac06
Author: Pratik Tibrewal <[email protected]>
AuthorDate: Sun Feb 19 11:20:38 2023 +0530

    [Quickstart] Improve error message and remove NullPointerException when 
connection fails (#10293)
    
    * [Quickstart] Improve error message and remove NullPointerException when 
connection fails
    
    * Update AbstractBaseAdminCommand.java
    
    ---------
    
    Co-authored-by: Xiang Fu <[email protected]>
---
 .../apache/pinot/tools/admin/command/AbstractBaseAdminCommand.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/AbstractBaseAdminCommand.java
 
b/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/AbstractBaseAdminCommand.java
index 85da5d31a4..b91c3bf83a 100644
--- 
a/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/AbstractBaseAdminCommand.java
+++ 
b/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/AbstractBaseAdminCommand.java
@@ -101,7 +101,10 @@ public class AbstractBaseAdminCommand extends 
AbstractBaseCommand {
     try {
       return readInputStream(conn.getInputStream());
     } catch (Exception e) {
-      return readInputStream(conn.getErrorStream());
+      if (conn.getErrorStream() != null) {
+        return readInputStream(conn.getErrorStream());
+      }
+      throw new IOException("Request failed due to connection error", e);
     }
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to