Specify which file not found in error (#11868)

# Description
Currently, `ShellError::FileNotFound` shows the span where the error
occurred but doesn't say which file wasn't found. This PR makes it so
the help includes that (like the `DirectoryNotFound` error).

# User-Facing Changes
No breaking changes, it's just that when a file can't be found, the help
will say which file couldn't be found:


![image](https://github.com/nushell/nushell/assets/45539777/e52f1e65-55c1-4cd2-8108-a4ccc334a66f)
This commit is contained in:
Yash Thakur
2024-02-21 08:27:13 -05:00
committed by GitHub
parent 1058707a29
commit 6ff3a4180b
8 changed files with 39 additions and 16 deletions

View File

@ -56,6 +56,7 @@ impl Command for SourceEnv {
PathBuf::from(&path)
} else {
return Err(ShellError::FileNotFound {
file: source_filename.item,
span: source_filename.span,
});
};