Skip to content

Commit

Permalink
Merge pull request #378 from paketo-buildpacks/symlink-error-polish
Browse files Browse the repository at this point in the history
Improve error when symlink cannot be accessed during walk
  • Loading branch information
dmikusa authored Nov 18, 2024
2 parents da0dc94 + 4de4bf7 commit eec8661
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sherpa/file_listing.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewFileListing(roots ...string) ([]FileEntry, error) {
if os.IsNotExist(err) {
continue
} else if err != nil {
results <- result{err: fmt.Errorf("unable to resolve %s\n%w", root, err)}
results <- result{err: fmt.Errorf("symlink path %s does not exist according to the OS\n%w", root, err)}
return
}

Expand Down Expand Up @@ -178,7 +178,7 @@ func isSymlinkToDir(symlink string, f os.FileInfo) (bool, error) {

stat, err := os.Stat(path)
if err != nil {
return false, fmt.Errorf("unable to stat file %s\n%w", path, err)
return false, fmt.Errorf("unable to stat file - source path contains a symlink that cannot be followed, at %s\n%w", path, err)
}

return stat.IsDir(), nil
Expand Down

0 comments on commit eec8661

Please sign in to comment.