Skip to content

Commit f1b69b6

Browse files
add more healthcheck logging
Signed-off-by: Nikita Skrynnik <[email protected]>
1 parent 35b221a commit f1b69b6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src-tauri/src/cef/utils.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,19 @@ pub fn get_cef_paths(app_handle: &tauri::AppHandle) -> Result<(PathBuf, PathBuf)
4040
}
4141

4242
pub fn wait_for_cef(port: u16) -> Result<(), String> {
43+
let mut last_error = String::new();
44+
4345
for _ in 0..10 {
4446
std::thread::sleep(std::time::Duration::from_millis(500));
45-
if connect(format!("ws://localhost:{}", port)).is_ok() {
46-
return Ok(());
47+
match connect(format!("ws://localhost:{}", port)) {
48+
Ok(_) => return Ok(()),
49+
Err(e) => {
50+
last_error = format!("CEF healthcheck failed: {}", e);
51+
}
4752
}
4853
}
4954

50-
Err("CEF healthcheck failed".into())
55+
Err(last_error)
5156
}
5257

5358
pub fn find_available_port() -> Result<u16, String> {

0 commit comments

Comments
 (0)