Skip to content

Commit 20f0fd3

Browse files
committed
feat(upload): bail when performance report s3 upload does not work
1 parent 7127d5d commit 20f0fd3

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/run/uploader/upload.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async fn upload_archive_buffer(
7878
archive_buffer: Vec<u8>,
7979
archive_hash: &String,
8080
) -> Result<()> {
81-
REQUEST_CLIENT
81+
let response = REQUEST_CLIENT
8282
.put(upload_data.upload_url.clone())
8383
.header("Content-Type", "application/gzip")
8484
.header("Content-Length", archive_buffer.len())
@@ -87,6 +87,17 @@ async fn upload_archive_buffer(
8787
.send()
8888
.await?;
8989

90+
if !response.status().is_success() {
91+
let status = response.status();
92+
let error_text = response.text().await?;
93+
bail!(
94+
"Failed to upload performance report: {}\n -> {} {}",
95+
status,
96+
style("Reason:").bold(),
97+
style(error_text).red()
98+
);
99+
}
100+
90101
Ok(())
91102
}
92103

0 commit comments

Comments
 (0)