fix: report S3 errors

This commit is contained in:
daimond113 2024-10-13 11:55:25 +02:00
parent 258850e9ea
commit 25260e5ab7
No known key found for this signature in database
GPG key ID: 3A8ECE51328B513C

View file

@ -15,7 +15,7 @@ pub struct S3Storage {
pub reqwest_client: reqwest::Client, pub reqwest_client: reqwest::Client,
} }
pub const S3_SIGN_DURATION: Duration = Duration::from_secs(60 * 3); pub const S3_SIGN_DURATION: Duration = Duration::from_secs(60 * 15);
impl StorageImpl for S3Storage { impl StorageImpl for S3Storage {
async fn store_package( async fn store_package(
@ -41,7 +41,8 @@ impl StorageImpl for S3Storage {
.header(CONTENT_ENCODING, "gzip") .header(CONTENT_ENCODING, "gzip")
.body(contents) .body(contents)
.send() .send()
.await?; .await?
.error_for_status()?;
Ok(()) Ok(())
} }
@ -90,7 +91,8 @@ impl StorageImpl for S3Storage {
.header(CONTENT_ENCODING, "gzip") .header(CONTENT_ENCODING, "gzip")
.body(contents) .body(contents)
.send() .send()
.await?; .await?
.error_for_status()?;
Ok(()) Ok(())
} }
@ -130,7 +132,8 @@ impl StorageImpl for S3Storage {
.header(CONTENT_ENCODING, "gzip") .header(CONTENT_ENCODING, "gzip")
.body(contents) .body(contents)
.send() .send()
.await?; .await?
.error_for_status()?;
Ok(()) Ok(())
} }