diff --git a/plugins/nf-amazon/src/main/nextflow/cloud/aws/nio/S3Client.java b/plugins/nf-amazon/src/main/nextflow/cloud/aws/nio/S3Client.java index e405cf64a..e89141de6 100644 --- a/plugins/nf-amazon/src/main/nextflow/cloud/aws/nio/S3Client.java +++ b/plugins/nf-amazon/src/main/nextflow/cloud/aws/nio/S3Client.java @@ -506,7 +506,11 @@ public void downloadDirectory(S3Path source, File targetFile) throws IOException DirectoryDownload downloadDirectory = transferManager().downloadDirectory(downloadDirRequest); try{ - downloadDirectory.completionFuture().get(); + CompletedDirectoryDownload completed = downloadDirectory.completionFuture().get(); + if (!completed.failedTransfers().isEmpty()){ + log.debug("S3 download directory: s3://{}/{} failed transfers", source.getBucket(), source.getKey()); + throw new IOException("Some transfers in S3 download directory: s3://"+ source.getBucket() +"/"+ source.getKey() +" has failed - Transfers: " + completed.failedTransfers() ); + } } catch (InterruptedException e){ log.debug("S3 download directory: s3://{}/{} interrupted", source.getBucket(), source.getKey()); Thread.currentThread().interrupt();