diff --git a/src/client.rs b/src/client.rs index 163213b..83753a5 100644 --- a/src/client.rs +++ b/src/client.rs @@ -116,18 +116,17 @@ impl Client { return Ok(bucket_region); } - let bucket_region = self + let result = self .client .get_bucket_location() .bucket(bucket_name) .send() - .await - .map_err(|e| { - AppError::new( - format!("Failed to fetch region for bucket {}", bucket_name), - e, - ) - })? + .await; + let output = result.map_err(|e| { + AppError::new(format!("Failed to fetch region for '{}'", bucket_name), e) + })?; + + let bucket_region = output .location_constraint() .map(|loc| { if loc.as_str().is_empty() {