aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2023-09-04 20:10:34 +0300
committereug-vs <eugene@eug-vs.xyz>2023-09-04 20:10:34 +0300
commit9f3ff7888ed5f2dfa0a42fe3176a4d8a2276f121 (patch)
tree075b6250e57b50e0f1a117913be2b4b5ef0248b4
parent46a1d59c7cea90bcb73bec226ebdd036479009c2 (diff)
downloadchessnost-9f3ff7888ed5f2dfa0a42fe3176a4d8a2276f121.tar.gz
feat: display search panics to UCI
-rw-r--r--src/grossmeister/UCI.rs12
1 files changed, 8 insertions, 4 deletions
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!");
}