Skip to content

Commit 78ef5e9

Browse files
authored
wrap user-facing mfs.Lookup error (#10821)
To avoid the blank Error: file does not exist and specify which file we failed to find. Error before: `Error: file does not exist` Error after: `Error: /my-cat-pic.jpg: file does not exist` Closes #8671
1 parent e491ee9 commit 78ef5e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/commands/files.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ Examples:
724724

725725
fsn, err := mfs.Lookup(nd.FilesRoot, path)
726726
if err != nil {
727-
return err
727+
return fmt.Errorf("%s: %w", path, err)
728728
}
729729

730730
fi, ok := fsn.(*mfs.File)

0 commit comments

Comments
 (0)