mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 07:35:42 +02:00
Bubble up errors passed to complete
(#11313)
Errors passed in `PipelineData::Value` get thrown in `complete` now. Also added two simple tests for the command. Fix #11187 Fix #10204
This commit is contained in:
@ -101,6 +101,8 @@ impl Command for Complete {
|
||||
|
||||
Ok(Value::record(record, call.head).into_pipeline_data())
|
||||
}
|
||||
// bubble up errors from the previous command
|
||||
PipelineData::Value(Value::Error { error, .. }, _) => Err(*error),
|
||||
_ => Err(ShellError::GenericError {
|
||||
error: "Complete only works with external streams".into(),
|
||||
msg: "complete only works on external streams".into(),
|
||||
|
Reference in New Issue
Block a user