1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

fix(test): propagate join errors in deno test (#11953)

This commit is contained in:
David Sherret 2021-09-08 11:18:07 -04:00 committed by GitHub
parent 5db1c401cd
commit 2958b05d0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -715,28 +715,12 @@ async fn test_specifiers(
let (join_results, result) = future::join(join_stream, handler).await;
let mut join_errors = join_results.into_iter().filter_map(|join_result| {
join_result
.ok()
.map(|handle_result| handle_result.err())
.flatten()
});
if let Some(e) = join_errors.next() {
return Err(e);
// propagate any errors
for join_result in join_results {
join_result??;
}
match result {
Ok(result) => {
if let Some(err) = result.err() {
return Err(err);
}
}
Err(err) => {
return Err(err.into());
}
}
result??;
Ok(())
}