Skip to content
Open
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
23 changes: 23 additions & 0 deletions crates/s3/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3593,6 +3593,29 @@ mod tests {
}
}

#[tokio::test]
async fn delete_bucket_maps_other_failures_to_network() {
let response = http::Response::builder()
.status(500)
.header("x-amz-error-code", "InternalError")
.body(SdkBody::from(
r#"<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>InternalError</Code>
<Message>Something went wrong.</Message>
</Error>"#,
))
.expect("build delete bucket response");
let (client, _request_receiver) = test_s3_client(Some(response));

let result = client.delete_bucket("bucket").await;

match result {
Err(Error::Network(message)) => assert!(message.contains("InternalError")),
other => panic!("Expected Network for delete bucket failure, got: {other:?}"),
}
}

#[tokio::test]
async fn delete_objects_with_force_delete_sets_rustfs_header() {
let response = http::Response::builder()
Expand Down