diff options
-rw-r--r-- | crates/core/tedge_core/src/reactor.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/crates/core/tedge_core/src/reactor.rs b/crates/core/tedge_core/src/reactor.rs index 21252537..2aa1de06 100644 --- a/crates/core/tedge_core/src/reactor.rs +++ b/crates/core/tedge_core/src/reactor.rs @@ -283,7 +283,7 @@ impl Reactor { .await; debug!("Running 'shutdown' for plugins"); - let _shutdown_results = all_plugins + let (_shutdown_results_ok, shutdown_results_err): (Vec<_>, Vec<_>) = all_plugins .iter_mut() .map(|plugin_task| { let span = @@ -293,7 +293,15 @@ impl Reactor { .collect::<futures::stream::FuturesOrdered<_>>() .collect::<Vec<Result<(), _>>>() .instrument(tracing::info_span!("core.mainloop.plugins.shutdown")) - .await; + .await + .into_iter() + .partition_result(); + + if !shutdown_results_err.is_empty() { + return Err(TedgeApplicationError::PluginLifecycleErrors { + errors: shutdown_results_err, + }); + } Ok(()) } |