Properly drain iterating pipe so we can see errors (#1707)

This commit is contained in:
Jonathan Turner 2020-05-04 15:29:32 +12:00 committed by GitHub
parent 81ff598d6c
commit 453087248a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);