Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/run/uploader/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async fn retrieve_upload_data(

match response {
Ok(response) => {
if response.status().is_client_error() {
if !response.status().is_success() {
let status = response.status();
let text = response.text().await?;
let mut error_message = serde_json::from_str::<UploadError>(&text)
Expand Down Expand Up @@ -78,7 +78,7 @@ async fn upload_archive_buffer(
archive_buffer: Vec<u8>,
archive_hash: &String,
) -> Result<()> {
REQUEST_CLIENT
let response = REQUEST_CLIENT
.put(upload_data.upload_url.clone())
.header("Content-Type", "application/gzip")
.header("Content-Length", archive_buffer.len())
Expand All @@ -87,6 +87,17 @@ async fn upload_archive_buffer(
.send()
.await?;

if !response.status().is_success() {
let status = response.status();
let error_text = response.text().await?;
bail!(
"Failed to upload performance report: {}\n -> {} {}",
status,
style("Reason:").bold(),
style(error_text).red()
);
}

Ok(())
}

Expand Down
Loading