forked from extern/nushell
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: 
This commit is contained in:
@ -727,8 +727,9 @@ pub enum ShellError {
|
||||
///
|
||||
/// Does the file in the error message exist? Is it readable and accessible? Is the casing right?
|
||||
#[error("File not found")]
|
||||
#[diagnostic(code(nu::shell::file_not_found))]
|
||||
#[diagnostic(code(nu::shell::file_not_found), help("{file} does not exist"))]
|
||||
FileNotFound {
|
||||
file: String,
|
||||
#[label("file not found")]
|
||||
span: Span,
|
||||
},
|
||||
|
Reference in New Issue
Block a user