diff --git a/io/aws/s3/reader.go b/io/aws/s3/reader.go index 17b298b9..90baf433 100644 --- a/io/aws/s3/reader.go +++ b/io/aws/s3/reader.go @@ -172,7 +172,7 @@ func (r *Reader) streamDirectory( } // We check *p.Key == nil in the beginning. - errorsCh <- fmt.Errorf("failed to create reader from directory %s: %w", *p.Key, err) + errorsCh <- fmt.Errorf("failed to create reader from directory file %s: %w", *p.Key, err) return } diff --git a/io/azure/blob/reader.go b/io/azure/blob/reader.go index 6fb017d8..e08a5e1d 100644 --- a/io/azure/blob/reader.go +++ b/io/azure/blob/reader.go @@ -19,6 +19,7 @@ import ( "errors" "fmt" "io" + "net/http" "path/filepath" "strings" @@ -142,11 +143,11 @@ func (r *Reader) streamDirectory( if err != nil { // Skip 404 not found error. var respErr *azcore.ResponseError - if errors.As(err, &respErr) && respErr.StatusCode == 404 { + if errors.As(err, &respErr) && respErr.StatusCode == http.StatusNotFound { continue } - errorsCh <- fmt.Errorf("failed to create reader from file %s: %w", *blob.Name, err) + errorsCh <- fmt.Errorf("failed to create reader from directory file %s: %w", *blob.Name, err) return } diff --git a/io/gcp/storage/reader.go b/io/gcp/storage/reader.go index f5df4523..e1e3df55 100644 --- a/io/gcp/storage/reader.go +++ b/io/gcp/storage/reader.go @@ -155,7 +155,7 @@ func (r *Reader) streamDirectory( if errors.Is(err, storage.ErrObjectNotExist) { continue } - errorsCh <- fmt.Errorf("failed to create reader from file %s: %w", objAttrs.Name, err) + errorsCh <- fmt.Errorf("failed to create reader from directory file %s: %w", objAttrs.Name, err) return } @@ -178,7 +178,7 @@ func (r *Reader) StreamFile( reader, err := r.bucketHandle.Object(filename).NewReader(ctx) if err != nil { - errorsCh <- fmt.Errorf("failed to open %s: %w", filename, err) + errorsCh <- fmt.Errorf("failed to create reader from file %s: %w", filename, err) return }