durch / rust-s3

Rust library for interfacing with S3 API compatible services
MIT License
498 stars 195 forks source link

`rust-s3` returns `Ok` result when garage responds with error #386

Closed MrFoxPro closed 2 months ago

MrFoxPro commented 2 months ago

rustc 1.79.0-nightly rust-s3 master branch garage 1.0.0

let result = self.bucket
  .put_object_with_content_type(&key, &buffer, "image/avif")
  .await;
dbg!(result);
result = Ok(
    ResponseData {
        bytes: b"",
        status_code: 400,
        headers: {
            "content-length": "268",
            "content-type": "application/xml",
            "date": "Tue, 23 Apr 2024 06:33:58 GMT",
        },
    },
)
MrFoxPro commented 2 months ago

OOps, I just realised there is special feature fail-on-err!. Sori.