Skip to content

Commit 736b113

Browse files
committed
Retry failed S3 uploads
1 parent f195a9d commit 736b113

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

apps/labrinth/src/file_hosting/s3_host.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ impl FileHost for S3Host {
7474
content_type,
7575
)
7676
.await
77-
.map_err(|_| {
78-
FileHostingError::S3Error(
79-
"Error while uploading file to S3".to_string(),
80-
)
77+
.map_err(|err| {
78+
FileHostingError::S3Error(format!(
79+
"Error while uploading file {file_name} to S3: {err}"
80+
))
8181
})?;
8282

8383
Ok(UploadFileData {
@@ -100,10 +100,10 @@ impl FileHost for S3Host {
100100
self.bucket
101101
.delete_object(format!("/{file_name}"))
102102
.await
103-
.map_err(|_| {
104-
FileHostingError::S3Error(
105-
"Error while deleting file from S3".to_string(),
106-
)
103+
.map_err(|err| {
104+
FileHostingError::S3Error(format!(
105+
"Error while deleting file {file_name} to S3: {err}"
106+
))
107107
})?;
108108

109109
Ok(DeleteFileData {

0 commit comments

Comments
 (0)