From ba1d900020e6bac3726d3d163c77afe6960d25cc Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Wed, 3 Jul 2024 07:43:07 -0500 Subject: [PATCH] create a better error message when saving fails (#13290) # Description This PR just creates a better error message when the `save` command fails. # User-Facing Changes # Tests + Formatting # After Submitting --- crates/nu-command/src/filesystem/save.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/nu-command/src/filesystem/save.rs b/crates/nu-command/src/filesystem/save.rs index fa14572987..e52234dfa3 100644 --- a/crates/nu-command/src/filesystem/save.rs +++ b/crates/nu-command/src/filesystem/save.rs @@ -461,7 +461,7 @@ fn open_file(path: &Path, span: Span, append: bool) -> Result }; file.map_err(|e| ShellError::GenericError { - error: "Permission denied".into(), + error: format!("Problem with [{}], Permission denied", path.display()), msg: e.to_string(), span: Some(span), help: None,