From 9f3ff7888ed5f2dfa0a42fe3176a4d8a2276f121 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Mon, 4 Sep 2023 20:10:34 +0300 Subject: feat: display search panics to UCI --- src/grossmeister/UCI.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/grossmeister/UCI.rs b/src/grossmeister/UCI.rs index 6f6556c..0c3c158 100644 --- a/src/grossmeister/UCI.rs +++ b/src/grossmeister/UCI.rs @@ -89,8 +89,10 @@ impl Grossmeister { "go" => { // Before we go, let's join to the latest search if let Some(hand) = search_handle.take() { - let better_self = hand.join().unwrap(); - self.transposition_table = better_self.transposition_table; + match hand.join() { + Ok(better_self) => self.transposition_table = better_self.transposition_table, + Err(err) => println!("info string error {:?}", err), + } } *search_handle = Some(self.parse_go(tokens, false)); @@ -108,9 +110,11 @@ impl Grossmeister { // Join to the current pondering search if let Some(hand) = search_handle.take() { - let better_self = hand.join().unwrap(); + match hand.join() { + Ok(better_self) => self.transposition_table = better_self.transposition_table, + Err(err) => println!("info string error {:?}", err), + } halt_scheduled.store(false, Ordering::SeqCst); // Cancel scheduled halting - self.transposition_table = better_self.transposition_table; } else { panic!("Search thread not found!"); } -- cgit v1.2.3