mirror of
https://github.com/nushell/nushell.git
synced 2025-01-11 00:38:23 +01:00
parent
e3bf6fdfc0
commit
ab0a6b6ca6
@ -89,7 +89,16 @@ fn handle_invalid_values(rest: Value, name: Span) -> Value {
|
||||
|
||||
fn err_from_value(rest: &Value, name: Span) -> ShellError {
|
||||
match rest.span() {
|
||||
Ok(span) => ShellError::PipelineMismatch("string, row or list".into(), name, span),
|
||||
Ok(span) => {
|
||||
if rest.is_nothing() {
|
||||
ShellError::UnsupportedInput(
|
||||
"Input type is nothing, expected: string, row or list".into(),
|
||||
name,
|
||||
)
|
||||
} else {
|
||||
ShellError::PipelineMismatch("string, row or list".into(), name, span)
|
||||
}
|
||||
}
|
||||
Err(error) => error,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user