From 55b319c6ca0cd7b47224b110676030c47cbf5b78 Mon Sep 17 00:00:00 2001 From: Nick Santana Date: Thu, 24 Oct 2024 08:49:52 -0700 Subject: [PATCH] Remove NoSuchKey path, it can't be hit for head-objects --- ledger/distribution/src/main.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ledger/distribution/src/main.rs b/ledger/distribution/src/main.rs index b7edce3c1a..d22246acf9 100644 --- a/ledger/distribution/src/main.rs +++ b/ledger/distribution/src/main.rs @@ -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 => {