Update OkHttpDataSource.java

This commit is contained in:
Emanuele Tidó 2021-01-06 00:19:06 +00:00 committed by GitHub
parent 75b222d8d4
commit 6d4b364530
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -304,13 +304,13 @@ public class OkHttpDataSource extends BaseDataSource implements HttpDataSource {
// Check for a valid response code.
if (!response.isSuccessful()) {
Map<String, List<String>> headers = response.headers().toMultimap();
byte[] errorResponseBody;
try {
errorResponseBody = Util.toByteArray(Assertions.checkNotNull(responseByteStream));
} catch (IOException e) {
errorResponseBody = Util.EMPTY_BYTE_ARRAY;
}
Map<String, List<String>> headers = response.headers().toMultimap();
closeConnectionQuietly();
InvalidResponseCodeException exception =
new InvalidResponseCodeException(