mirror of
https://github.com/nushell/nushell.git
synced 2024-11-12 19:44:42 +01:00
Properly drain iterating pipe so we can see errors (#1707)
This commit is contained in:
parent
81ff598d6c
commit
453087248a
@ -82,14 +82,14 @@ fn each(
|
||||
|
||||
match result {
|
||||
Ok(mut stream) => {
|
||||
while let Some(result) = stream.next().await {
|
||||
yield Ok(ReturnSuccess::Value(result));
|
||||
}
|
||||
|
||||
let errors = context.get_errors();
|
||||
if let Some(error) = errors.first() {
|
||||
yield Err(error.clone());
|
||||
}
|
||||
|
||||
while let Some(result) = stream.next().await {
|
||||
yield Ok(ReturnSuccess::Value(result));
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
yield Err(e);
|
||||
|
Loading…
Reference in New Issue
Block a user