From f61b3b030b7723b8107cac3a76e823f5e528db73 Mon Sep 17 00:00:00 2001 From: gagliardetto Date: Wed, 21 Feb 2024 15:57:32 +0100 Subject: [PATCH] Improve errors --- epoch.go | 4 ++-- storage.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epoch.go b/epoch.go index 8d207a5c..3e85ecdd 100644 --- a/epoch.go +++ b/epoch.go @@ -339,7 +339,7 @@ func NewEpochFromConfig( formattedURL, ) if err != nil { - return nil, fmt.Errorf("failed to create remote file split car reader: %w", err) + return nil, fmt.Errorf("failed to create remote file split car reader from %q: %w", formattedURL, err) } return &readCloserWrapper{ @@ -371,7 +371,7 @@ func NewEpochFromConfig( formattedURL, ) if err != nil { - return nil, fmt.Errorf("failed to create remote file split car reader: %w", err) + return nil, fmt.Errorf("failed to create remote file split car reader from %q: %w", formattedURL, err) } return &readCloserWrapper{ diff --git a/storage.go b/storage.go index e553ac51..ddc4995a 100644 --- a/storage.go +++ b/storage.go @@ -31,7 +31,7 @@ func openIndexStorage( klog.Infof("opening index file from %q as HTTP remote file", where) rac, size, err := splitcarfetcher.NewRemoteHTTPFileAsIoReaderAt(ctx, where) if err != nil { - return nil, fmt.Errorf("failed to open remote index file: %w", err) + return nil, fmt.Errorf("failed to open remote index file %q: %w", where, err) } if !klog.V(5).Enabled() { return rac, nil @@ -65,7 +65,7 @@ func openCarStorage(ctx context.Context, where string) (*carv2.Reader, ReaderAtC klog.Infof("opening CAR file from %q as HTTP remote file", where) rem, size, err := splitcarfetcher.NewRemoteHTTPFileAsIoReaderAt(ctx, where) if err != nil { - return nil, nil, fmt.Errorf("failed to open remote CAR file: %w", err) + return nil, nil, fmt.Errorf("failed to open remote CAR file %q: %w", where, err) } return nil, &readCloserWrapper{ rac: rem,