mirror of
https://github.com/nushell/nushell
synced 2024-12-26 21:13:19 +00:00
Merge pull request #976 from bndbsh/save-error
Improve error messages for save
This commit is contained in:
commit
9dfc647386
1 changed files with 4 additions and 4 deletions
|
@ -19,8 +19,8 @@ macro_rules! process_string {
|
|||
}
|
||||
_ => {
|
||||
break $scope Err(ShellError::labeled_error(
|
||||
"Save could not successfully save",
|
||||
"unexpected data during save",
|
||||
"Save requires string data",
|
||||
"consider converting data to string (see `help commands`)",
|
||||
$name_tag,
|
||||
));
|
||||
}
|
||||
|
@ -214,9 +214,9 @@ fn save(
|
|||
match content {
|
||||
Ok(save_data) => match std::fs::write(full_path, save_data) {
|
||||
Ok(o) => o,
|
||||
Err(e) => yield Err(ShellError::labeled_error(e.to_string(), "for command", name)),
|
||||
Err(e) => yield Err(ShellError::labeled_error(e.to_string(), "IO error while saving", name)),
|
||||
},
|
||||
Err(e) => yield Err(ShellError::labeled_error(e.to_string(), "for command", name)),
|
||||
Err(e) => yield Err(e),
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue