Skip to content

Commit 956d779

Browse files
committed
Fix a bug in NetHttpResponse (don't catch IOException when getErrorStream)
1 parent 3367002 commit 956d779

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

google-http-client/src/main/java/com/google/api/client/http/javanet/NetHttpResponse.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,7 @@ public InputStream getContent() throws IOException {
7676
try {
7777
return connection.getInputStream();
7878
} catch (IOException ioe) {
79-
InputStream stream = connection.getErrorStream();
80-
// if the stream is not null then the error was set on the error stream, otherwise we should
81-
// just rethrow the I/O exception.
82-
if (stream == null) {
83-
throw ioe;
84-
}
85-
return stream;
79+
return connection.getErrorStream();
8680
}
8781
}
8882

0 commit comments

Comments
 (0)