Always apply Both outcomes, even when the first fails

This commit is contained in:
Félix Saparelli 2021-09-03 05:41:21 +12:00
parent 8e4994abca
commit f880b0b38a
No known key found for this signature in database
GPG Key ID: B948C4BAE44FC474
1 changed files with 10 additions and 2 deletions

View File

@ -321,6 +321,7 @@ async fn apply_outcome(
errors: mpsc::Sender<RuntimeError>,
events: mpsc::Sender<Event>,
) -> Result<(), RuntimeError> {
trace!(?outcome, "applying outcome");
match (process.as_mut(), outcome) {
(_, Outcome::DoNothing) => {}
(_, Outcome::Exit) => {
@ -409,7 +410,7 @@ async fn apply_outcome(
}
(_, Outcome::Both(one, two)) => {
apply_outcome(
if let Err(err) = apply_outcome(
*one,
working.clone(),
process,
@ -418,7 +419,14 @@ async fn apply_outcome(
errors.clone(),
events.clone(),
)
.await?;
.await
{
debug!(
"first outcome failed, sending an error but proceeding to the second anyway"
);
errors.send(err).await.ok();
}
apply_outcome(
*two,
working,