-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Provide better error output when file doesn't exist #8546
Copy link
Copy link
Closed
Labels
A:error-unhelpfulThe error message you observe is not helpful to identify the problemThe error message you observe is not helpful to identify the problem
Milestone
Description
Describe the bug
If you use mv with a path that doesn't exist, you get this error:
Error:
× Invalid file or pattern
╭─[entry #1:1:1]
1 │ mv foo.txt bar.txt
· ───┬───
· ╰── invalid file or pattern
╰────
But it's not clear what "invalid" means in this case. It could mean, for example, that the filename itself is somehow invalid. I think something like this would be preferable:
Error:
× Invalid move operation
╭─[entry #1:1:1]
1 │ mv foo.txt bar.txt
· ───┬───
· ╰── file or directory does not exist
╰────
How to reproduce
nu -c "mv definitely-does-not-exist.txt some-other-filename.txt"Expected behavior
I'd expect something at least as helpful as what you get from Bash et al:
mv: cannot stat 'foo.txt': No such file or directory
Screenshots
No response
Configuration
In principle, any Nushell config
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:error-unhelpfulThe error message you observe is not helpful to identify the problemThe error message you observe is not helpful to identify the problem