From 736b11371305004a7783c5f338b01f910b0d9bf0 Mon Sep 17 00:00:00 2001 From: Jai A Date: Fri, 27 Dec 2024 17:58:16 -0700 Subject: [PATCH] Retry failed S3 uploads --- apps/labrinth/src/file_hosting/s3_host.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/labrinth/src/file_hosting/s3_host.rs b/apps/labrinth/src/file_hosting/s3_host.rs index 87be229ab..c48937811 100644 --- a/apps/labrinth/src/file_hosting/s3_host.rs +++ b/apps/labrinth/src/file_hosting/s3_host.rs @@ -74,10 +74,10 @@ impl FileHost for S3Host { content_type, ) .await - .map_err(|_| { - FileHostingError::S3Error( - "Error while uploading file to S3".to_string(), - ) + .map_err(|err| { + FileHostingError::S3Error(format!( + "Error while uploading file {file_name} to S3: {err}" + )) })?; Ok(UploadFileData { @@ -100,10 +100,10 @@ impl FileHost for S3Host { self.bucket .delete_object(format!("/{file_name}")) .await - .map_err(|_| { - FileHostingError::S3Error( - "Error while deleting file from S3".to_string(), - ) + .map_err(|err| { + FileHostingError::S3Error(format!( + "Error while deleting file {file_name} to S3: {err}" + )) })?; Ok(DeleteFileData {