forked from extern/nushell
update miette and switch to GenericErrors (#5222)
This commit is contained in:
@ -114,12 +114,14 @@ fn expand(path: &Path, span: Span, args: &Arguments) -> Value {
|
||||
Value::string(p.to_string_lossy(), span)
|
||||
} else if args.strict {
|
||||
Value::Error {
|
||||
error: ShellError::SpannedLabeledError(
|
||||
error: ShellError::GenericError(
|
||||
"Could not expand path".into(),
|
||||
"could not be expanded (path might not exist, non-final \
|
||||
component is not a directory, or other cause)"
|
||||
.into(),
|
||||
span,
|
||||
Some(span),
|
||||
None,
|
||||
Vec::new(),
|
||||
),
|
||||
}
|
||||
} else {
|
||||
|
@ -120,7 +120,7 @@ fn relative_to(path: &Path, span: Span, args: &Arguments) -> Value {
|
||||
match lhs.strip_prefix(&rhs) {
|
||||
Ok(p) => Value::string(p.to_string_lossy(), span),
|
||||
Err(e) => Value::Error {
|
||||
error: ShellError::CantConvert(e.to_string(), "string".into(), span),
|
||||
error: ShellError::CantConvert(e.to_string(), "string".into(), span, None),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user