diff --git a/src/watcher.rs b/src/watcher.rs index 816219f..c5bb857 100644 --- a/src/watcher.rs +++ b/src/watcher.rs @@ -59,10 +59,15 @@ impl FileWatcher { let running = Arc::new(AtomicBool::new(true)); let r = running.clone(); - ctrlc::set_handler(move || { + if let Err(e) = ctrlc::set_handler(move || { r.store(false, Ordering::SeqCst); - }) - .expect("Error setting Ctrl+C handler"); + }) { + eprintln!( + "{} Failed to set Ctrl+C handler: {}", + style("Warning:").yellow().bold(), + e + ); + } // Initial index println!(" {} Initial indexing...", style(">>").dim());