cmd/htpacker: report filename on I/O error

This commit is contained in:
Laurence Withers 2020-04-02 12:25:23 +01:00
parent f70914aa38
commit 52213cf67e
1 changed files with 1 additions and 1 deletions

View File

@ -128,7 +128,7 @@ func filesFromListR(prefix, arg string, ftp packer.FilesToPack) error {
buf := make([]byte, 512)
n, err := f.Read(buf)
if err != nil {
return err
return fmt.Errorf("failed to read %s: %v", arg, err)
}
buf = buf[:n]
ctype := http.DetectContentType(buf)