From a73ae7ba1a28743aa8a492d932745b66da5c04d6 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Mon, 11 Nov 2024 21:37:28 +0100 Subject: [PATCH] restore: improve error if timestamp fails to restore --- internal/fs/node.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/fs/node.go b/internal/fs/node.go index d36194322..50781b4c6 100644 --- a/internal/fs/node.go +++ b/internal/fs/node.go @@ -1,6 +1,7 @@ package fs import ( + "fmt" "os" "os/user" "strconv" @@ -296,7 +297,7 @@ func nodeRestoreTimestamps(node *restic.Node, path string) error { mtime := node.ModTime.UnixNano() if err := utimesNano(fixpath(path), atime, mtime, node.Type); err != nil { - return &os.PathError{Op: "UtimesNano", Path: path, Err: err} + return fmt.Errorf("failed to restore timestamp of %q: %w", path, err) } return nil }