From 051b84f3f6e06cfef4679d50c3550eb054742dd4 Mon Sep 17 00:00:00 2001 From: David Gilligan-Cook Date: Thu, 30 May 2024 16:00:38 -0700 Subject: [PATCH] Changed readline error handling to log as a warning and continue, rather than error out Signed-off-by: David Gilligan-Cook --- crates/spk-solve/src/io.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/spk-solve/src/io.rs b/crates/spk-solve/src/io.rs index f9082796c4..22f1b815d2 100644 --- a/crates/spk-solve/src/io.rs +++ b/crates/spk-solve/src/io.rs @@ -196,7 +196,9 @@ where let _ = std::io::stdout().flush(); if let Err(err) = std::io::stdin().read_line(&mut _input) { - return Err(Error::String(err.to_string())); + // If there's some stdin can't be read, it is probably + // better to continue with the solve than error out. + tracing::warn!("{err}"); } Ok(()) } @@ -349,7 +351,7 @@ where new_level = destination.state_depth; // Ensures the solver will stop before the next // decision because of this (BLOCKED) change, if - // stop-on-block is enabled. + // stop-on-block or step-on-block are enabled. stop_because_blocked = self.settings.stop_on_block; step_because_blocked = self.settings.step_on_block; }