Skip to content

Commit

Permalink
Gracefully handle exceptions in httpclient callback to avoid hanging (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasasx authored Jan 16, 2025
1 parent 795af0b commit ba3d0f1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api/src/main/java/io/minio/S3Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,14 @@ public void onFailure(final Call call, IOException e) {

@Override
public void onResponse(Call call, final Response response) throws IOException {
try {
onResponse(response);
} catch (Exception e) {
completableFuture.completeExceptionally(e);
}
}

private void onResponse(final Response response) throws IOException {
String trace =
response.protocol().toString().toUpperCase(Locale.US)
+ " "
Expand Down

0 comments on commit ba3d0f1

Please sign in to comment.