Skip to content

Commit

Permalink
Adjust error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
delsner committed Jan 12, 2025
1 parent 6304919 commit 5600720
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions crates/rattler_networking/src/s3_middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl S3 {
))
}
(_, Some(_)) => {
return Err(anyhow::anyhow!("Unsupported authentication method"));
return Err(anyhow::anyhow!("unsupported authentication method"));
}
(_, None) => {
tracing::info!("No authentication found, assuming bucket is public");
Expand Down Expand Up @@ -153,15 +153,10 @@ impl S3 {
let bucket_name = url.host_str().ok_or_else(|| {
reqwest_middleware::Error::middleware(std::io::Error::new(
std::io::ErrorKind::Other,
"Host should be present in S3 URL",
))
})?;
let key = url.path().strip_prefix("/").ok_or_else(|| {
reqwest_middleware::Error::middleware(std::io::Error::new(
std::io::ErrorKind::Other,
"Missing prefix",
"host should be present in S3 URL",
))
})?;
let key = url.path().strip_prefix("/").unwrap();

let builder = client.get_object().bucket(bucket_name).key(key);

Expand Down

0 comments on commit 5600720

Please sign in to comment.