Skip to content

Commit

Permalink
Changed readline error handling to log as a warning and continue, rat…
Browse files Browse the repository at this point in the history
…her than error out

Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
  • Loading branch information
dcookspi committed May 30, 2024
1 parent b9d7646 commit 051b84f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/spk-solve/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 051b84f

Please sign in to comment.