feat: actually bubble up errors
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
14371cdfd7
commit
ea5287152c
@ -197,6 +197,7 @@ impl Mad {
|
|||||||
futures.push(channel.recv());
|
futures.push(channel.recv());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut errors = Vec::new();
|
||||||
while let Some(Some(msg)) = futures.next().await {
|
while let Some(Some(msg)) = futures.next().await {
|
||||||
match msg.res {
|
match msg.res {
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
@ -205,6 +206,7 @@ impl Mad {
|
|||||||
component = msg.name,
|
component = msg.name,
|
||||||
"component ran to completion with error"
|
"component ran to completion with error"
|
||||||
);
|
);
|
||||||
|
errors.push(e);
|
||||||
}
|
}
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
tracing::debug!(component = msg.name, "component ran to completion");
|
tracing::debug!(component = msg.name, "component ran to completion");
|
||||||
@ -215,6 +217,9 @@ impl Mad {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tracing::debug!("ran components");
|
tracing::debug!("ran components");
|
||||||
|
if !errors.is_empty() {
|
||||||
|
return Err(MadError::AggregateError(AggregateError { errors }));
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user