Skip to content

Commit

Permalink
Improve errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gagliardetto committed Feb 21, 2024
1 parent 4396069 commit f61b3b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions epoch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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{
Expand Down
4 changes: 2 additions & 2 deletions storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit f61b3b0

Please sign in to comment.