Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor update to test utility to check if the server has actually sent…

… a response before trying to use it, corrects a NullPointerException that was masking real failures.
  • Loading branch information...
commit 6a1afdea271e029e8c6c4cd2eeeb62de26f6bb47 1 parent 1fbf1ef
@darranl darranl authored kabir committed
View
7 testsuite/shared/src/main/java/org/jboss/as/test/integration/common/HttpRequest.java
@@ -151,10 +151,13 @@ private static String processResponse(HttpURLConnection conn) throws IOException
if (responseCode != HttpURLConnection.HTTP_OK) {
final InputStream err = conn.getErrorStream();
try {
- throw new IOException("HTTP Status " + responseCode + " Response: " + read(err));
+ String response = err != null ? read(err) : null;
+ throw new IOException(String.format("HTTP Status %d Response: %s", responseCode, response));
}
finally {
- err.close();
+ if (err != null) {
+ err.close();
+ }
}
}
final InputStream in = conn.getInputStream();
Please sign in to comment.
Something went wrong with that request. Please try again.