Skip to content

Commit ba3d0f1

Browse files
authored
Gracefully handle exceptions in httpclient callback to avoid hanging (#1615)
1 parent 795af0b commit ba3d0f1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

api/src/main/java/io/minio/S3Base.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,14 @@ public void onFailure(final Call call, IOException e) {
615615

616616
@Override
617617
public void onResponse(Call call, final Response response) throws IOException {
618+
try {
619+
onResponse(response);
620+
} catch (Exception e) {
621+
completableFuture.completeExceptionally(e);
622+
}
623+
}
624+
625+
private void onResponse(final Response response) throws IOException {
618626
String trace =
619627
response.protocol().toString().toUpperCase(Locale.US)
620628
+ " "

0 commit comments

Comments
 (0)