dump: Report filename with tar.ErrFieldTooLong

Updates #4307.
This commit is contained in:
greatroar 2023-04-27 11:45:41 +02:00
parent 49e32f3f8a
commit b50ff04cf3
2 changed files with 32 additions and 2 deletions

View file

@ -3,6 +3,7 @@ package dump
import (
"archive/tar"
"context"
"fmt"
"os"
"path/filepath"
"strings"
@ -94,9 +95,8 @@ func (d *Dumper) dumpNodeTar(ctx context.Context, node *restic.Node, w *tar.Writ
err = w.WriteHeader(header)
if err != nil {
return errors.Wrap(err, "TarHeader")
return fmt.Errorf("writing header for %q: %w", node.Path, err)
}
return d.writeNode(ctx, w, node)
}