diff --git a/src/bin/main.rs b/src/bin/main.rs index d54748b..9f1b415 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -10,7 +10,14 @@ async fn main() -> Result<(), BoxError> { env_logger::Builder::from_env(env_logger::Env::default().default_filter_or(default)).init(); let shutdown_token = tokio_util::sync::CancellationToken::new(); - let join_handle = tokio::spawn(desktop_run_async(args, shutdown_token.clone())); + let join_handle = tokio::spawn({ + let shutdown_token = shutdown_token.clone(); + async move { + if let Err(err) = desktop_run_async(args, shutdown_token).await { + log::error!("desktop_run_async error: {}", err); + } + } + }); ctrlc2::set_async_handler(async move { log::info!("Ctrl-C received, exiting...");