Skip to content

Commit

Permalink
bugtool: show error on Copy in tarAddFile
Browse files Browse the repository at this point in the history
We could also use CopyN using fileSrcInfo.Size() but it would silently
copy empty files in the case of cgroup fs for example. Let's just
display an error so that we can see what failed.

Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
  • Loading branch information
mtardy committed Sep 9, 2024
1 parent 7b4e845 commit bfba5e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/bugtool/bugtool.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (s *bugtoolInfo) tarAddFile(tarWriter *tar.Writer, fnameSrc string, fnameDs

_, err = io.Copy(tarWriter, fileSrc)
if err != nil {
s.multiLog.WithField("fnameSrc", fnameSrc).Warn("error copying data from source file")
s.multiLog.WithError(err).WithField("fnameSrc", fnameSrc).Warn("error copying data from source file")
return err
}

Expand Down

0 comments on commit bfba5e9

Please sign in to comment.