You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "xiangfu0 (via GitHub)" <gi...@apache.org> on 2023/02/18 09:48:52 UTC

[GitHub] [pinot] xiangfu0 commented on a diff in pull request #10293: [Quickstart] Improve error message and remove NullPointerException when connection fails

xiangfu0 commented on code in PR #10293:
URL: https://github.com/apache/pinot/pull/10293#discussion_r1110973216


##########
pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/AbstractBaseAdminCommand.java:
##########
@@ -101,11 +102,14 @@ public static String sendRequest(String requestMethod, String urlString, String
     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);
     }
   }
 
-  private static String readInputStream(InputStream inputStream)
+  private static String readInputStream(@NotNull InputStream inputStream)

Review Comment:
   We only annotation @nullable and assume all the methods signature is not null.
   



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

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org