Skip to content

Commit

Permalink
fix: return error instead of panic when fail to upload artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
keroro520 committed Dec 24, 2024
1 parent 445e5e6 commit e18c4de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/sdk/src/network/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ impl NetworkClient {
self.http.put(&presigned_url).body(bincode::serialize::<T>(item)?).send().await?;

if !response.status().is_success() {
log::debug!("Artifact upload failed with status: {}", response.status());
log::error!("Artifact upload failed with status: {}", response.status());
return Err(anyhow::anyhow!("failed to upload artifact: HTTP {}", response.status()));
}
assert!(response.status().is_success());

Ok(uri)
}
Expand Down

0 comments on commit e18c4de

Please sign in to comment.