From bd20171975e913e429048a0a30328811fc4c8a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=AA=E9=98=BF=E5=8D=97?= Date: Fri, 26 Jul 2024 00:06:07 +0800 Subject: [PATCH] fix(blooms): Improve error wrap to make ignoreNotFound work when fetching blocks (#13656) Fix an issue where the `options.ignoreNotFound` of the fetcher is not effective. The root cause of this issue is that the error returned by `fmt.Errorf()` in `BloomClient` loses the underlying cause. As a result, `S3ObjectClient.IsObjectNotFoundErr()` fails to determine if the underlying cause of the returned error is of type `awserr.Error`. --- pkg/storage/stores/shipper/bloomshipper/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/storage/stores/shipper/bloomshipper/client.go b/pkg/storage/stores/shipper/bloomshipper/client.go index f6da2168ae..2ce0e0a149 100644 --- a/pkg/storage/stores/shipper/bloomshipper/client.go +++ b/pkg/storage/stores/shipper/bloomshipper/client.go @@ -316,7 +316,7 @@ func (b *BloomClient) GetBlock(ctx context.Context, ref BlockRef) (BlockDirector rc, _, err := b.client.GetObject(ctx, key) if err != nil { - return BlockDirectory{}, fmt.Errorf("failed to get block file %s: %w", key, err) + return BlockDirectory{}, errors.Wrap(err, fmt.Sprintf("failed to get block file %s", key)) } defer rc.Close()