mirror of
https://github.com/restic/restic.git
synced 2025-12-03 21:21:47 +00:00
all: Replace some errors.Wrap calls by errors.WithStack
Mostly changed the ones that repeat the name of a system call, which is already contained in os.PathError.Op. internal/fs.Reader had to be changed to actually return such errors.
This commit is contained in:
@@ -110,7 +110,7 @@ func (r *packerManager) newPacker() (packer *Packer, err error) {
|
||||
debug.Log("create new pack")
|
||||
tmpfile, err := fs.TempFile("", "restic-temp-pack-")
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "fs.TempFile")
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
bufWr := bufio.NewWriter(tmpfile)
|
||||
@@ -183,7 +183,7 @@ func (r *Repository) savePacker(ctx context.Context, t restic.BlobType, p *Packe
|
||||
if runtime.GOOS != "windows" {
|
||||
err = fs.RemoveIfExists(p.tmpfile.Name())
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Remove")
|
||||
return errors.WithStack(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user