Skip to content

Commit 43ab4ae

Browse files
authored
Conditionally throw exception from uploadParts failure. (#1595)
Signed-off-by: Bala.FA <bala@minio.io>
1 parent d83557a commit 43ab4ae

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2849,14 +2849,14 @@ private CompletableFuture<ObjectWriteResponse> putMultipartObjectAsync(
28492849
| XmlParserException
28502850
| InterruptedException
28512851
| ExecutionException e) {
2852+
Throwable throwable = e;
2853+
if (throwable instanceof ExecutionException) {
2854+
throwable = ((ExecutionException) throwable).getCause();
2855+
}
2856+
if (throwable instanceof CompletionException) {
2857+
throwable = ((CompletionException) throwable).getCause();
2858+
}
28522859
if (uploadId == null) {
2853-
Throwable throwable = e;
2854-
if (throwable instanceof ExecutionException) {
2855-
throwable = ((ExecutionException) throwable).getCause();
2856-
}
2857-
if (throwable instanceof CompletionException) {
2858-
throwable = ((CompletionException) throwable).getCause();
2859-
}
28602860
throw new CompletionException(throwable);
28612861
}
28622862
try {
@@ -2871,15 +2871,15 @@ private CompletableFuture<ObjectWriteResponse> putMultipartObjectAsync(
28712871
| XmlParserException
28722872
| InterruptedException
28732873
| ExecutionException ex) {
2874-
Throwable throwable = ex;
2874+
throwable = ex;
28752875
if (throwable instanceof ExecutionException) {
28762876
throwable = ((ExecutionException) throwable).getCause();
28772877
}
28782878
if (throwable instanceof CompletionException) {
28792879
throwable = ((CompletionException) throwable).getCause();
28802880
}
2881-
throw new CompletionException(throwable);
28822881
}
2882+
throw new CompletionException(throwable);
28832883
}
28842884
return response;
28852885
});

0 commit comments

Comments
 (0)