use anyhow::{anyhow, Result}; use aws_sdk_s3::{operation::head_bucket::HeadBucketOutput, Client, error::ProvideErrorMetadata}; use crate::models::Configuration; pub async fn check_bucket(client: &Client, config: &Configuration) -> Result { println!("{}",&config.s3_bucket); let res = client.head_bucket().bucket(&config.s3_bucket).send().await; res.map_err(|e| anyhow!("Cannot access the binary cache bucket: {}", e)) }