Skip to content

Commit

Permalink
Remove NoSuchKey path, it can't be hit for head-objects
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-mobilecoin committed Oct 24, 2024
1 parent 910fad0 commit 55b319c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ledger/distribution/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,8 @@ impl BlockHandler for S3BlockWriter {
let result = runtime.block_on(self.s3_client.head_object(req));
match result {
Ok(_) => OperationResult::Ok(true),
Err(RusotoError::Service(HeadObjectError::NoSuchKey(_))) => {
OperationResult::Ok(false)
}
// Happens when the bucket itself doesn't exist
// Separate from the above condition for the `status.as_u16()` logic
// Happens when the object doesn't exist, see
// https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html
Err(RusotoError::Unknown(BufferedHttpResponse { status, .. }))
if status.as_u16() == 404 =>
{
Expand Down

0 comments on commit 55b319c

Please sign in to comment.