mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 16:05:01 +02:00
Better error messages.
This commit is contained in:
@ -251,7 +251,7 @@ impl ExternalCommand {
|
||||
)
|
||||
} else {
|
||||
ShellError::labeled_error(
|
||||
"Error: $it needs string data",
|
||||
"$it needs string data",
|
||||
"given something else",
|
||||
self.name_tag.clone(),
|
||||
)
|
||||
|
@ -71,7 +71,7 @@ pub fn config(
|
||||
if let Some(v) = get {
|
||||
let key = v.to_string();
|
||||
let value = result.get(&key).ok_or_else(|| {
|
||||
ShellError::labeled_error(&format!("Missing key in config"), "key", v.tag())
|
||||
ShellError::labeled_error("Missing key in config", "key", v.tag())
|
||||
})?;
|
||||
|
||||
let mut results = VecDeque::new();
|
||||
@ -121,7 +121,7 @@ pub fn config(
|
||||
config::write(&result, &configuration)?;
|
||||
} else {
|
||||
return Err(ShellError::labeled_error(
|
||||
"{} does not exist in config",
|
||||
"Key does not exist in config",
|
||||
"key",
|
||||
v.tag(),
|
||||
));
|
||||
|
Reference in New Issue
Block a user