Skip to content

Commit

Permalink
fix(blooms): Improve error wrap to make ignoreNotFound work when fetc…
Browse files Browse the repository at this point in the history
…hing 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`.
  • Loading branch information
honganan committed Jul 25, 2024
1 parent cda7fc8 commit bd20171
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/storage/stores/shipper/bloomshipper/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit bd20171

Please sign in to comment.