From 25260e5ab70371d83450166780b40e46d50b6cf5 Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Sun, 13 Oct 2024 11:55:25 +0200 Subject: [PATCH] fix: report S3 errors --- registry/src/storage/s3.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/registry/src/storage/s3.rs b/registry/src/storage/s3.rs index 3168b03..1e5cdd0 100644 --- a/registry/src/storage/s3.rs +++ b/registry/src/storage/s3.rs @@ -15,7 +15,7 @@ pub struct S3Storage { 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 { async fn store_package( @@ -41,7 +41,8 @@ impl StorageImpl for S3Storage { .header(CONTENT_ENCODING, "gzip") .body(contents) .send() - .await?; + .await? + .error_for_status()?; Ok(()) } @@ -90,7 +91,8 @@ impl StorageImpl for S3Storage { .header(CONTENT_ENCODING, "gzip") .body(contents) .send() - .await?; + .await? + .error_for_status()?; Ok(()) } @@ -130,7 +132,8 @@ impl StorageImpl for S3Storage { .header(CONTENT_ENCODING, "gzip") .body(contents) .send() - .await?; + .await? + .error_for_status()?; Ok(()) }