Skip to content

Commit

Permalink
APPS-1338-skip-not-found-error
Browse files Browse the repository at this point in the history
- cosmetics
  • Loading branch information
filkeith committed Nov 17, 2024
1 parent 8026784 commit 8d7d284
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion io/aws/s3/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
5 changes: 3 additions & 2 deletions io/azure/blob/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"errors"
"fmt"
"io"
"net/http"
"path/filepath"
"strings"

Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions io/gcp/storage/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}

Expand Down

0 comments on commit 8d7d284

Please sign in to comment.