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`.
pull/13666/head
洪阿南 1 year ago committed by GitHub
parent cda7fc86a5
commit bd20171975
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      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()

Loading…
Cancel
Save