From 771166968efd93f458a9b608c2905619e23385b7 Mon Sep 17 00:00:00 2001 From: Nikita Galaiko Date: Tue, 11 Apr 2023 10:54:39 +0200 Subject: [PATCH] pty-ws: log error when fail to listen --- src-tauri/src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 9c0d69c34..4e7d66912 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -727,7 +727,12 @@ fn init(app_handle: tauri::AppHandle) -> Result<()> { } } - tauri::async_runtime::spawn(pty::start_server(app_state.projects_storage.clone())); + let project_storage = app_state.projects_storage.clone(); + tauri::async_runtime::spawn(async move { + if let Err(e) = pty::start_server(project_storage).await { + log::error!("failed to start pty server: {:#}", e); + } + }); watch_events(app_handle, rx);