From cfbc5fabb1c630112efcca59511d7ebc76981f40 Mon Sep 17 00:00:00 2001 From: ssrlive <30760636+ssrlive@users.noreply.github.com> Date: Sat, 24 Feb 2024 19:24:51 +0800 Subject: [PATCH] print error info --- src/bin/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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...");