summaryrefslogtreecommitdiff
path: root/cli/tools/repl/mod.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-12-16 17:11:10 +0100
committerGitHub <noreply@github.com>2022-12-16 17:11:10 +0100
commitff71ef81751da1babdc4f9d1df5c279e7c64f305 (patch)
tree246cb7e45de792f1d87b2cb6071ae0d44d5f15fc /cli/tools/repl/mod.rs
parentd7f4298015bd98ba5806ec48ee35e4be61a4143e (diff)
fix(repl): errors shouldn't terminate repl (#17082)
This commit changes REPL to never surface errors coming from code execution, but instead print them as errors to the REPL itself.
Diffstat (limited to 'cli/tools/repl/mod.rs')
-rw-r--r--cli/tools/repl/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/tools/repl/mod.rs b/cli/tools/repl/mod.rs
index ff438aeb2..8fcae505e 100644
--- a/cli/tools/repl/mod.rs
+++ b/cli/tools/repl/mod.rs
@@ -107,7 +107,7 @@ pub async fn run(flags: Flags, repl_flags: ReplFlags) -> Result<i32, AnyError> {
Ok(eval_source) => {
let output = repl_session
.evaluate_line_and_get_output(&eval_source)
- .await?;
+ .await;
// only output errors
if let EvaluationOutput::Error(error_text) = output {
println!(
@@ -124,7 +124,7 @@ pub async fn run(flags: Flags, repl_flags: ReplFlags) -> Result<i32, AnyError> {
}
if let Some(eval) = repl_flags.eval {
- let output = repl_session.evaluate_line_and_get_output(&eval).await?;
+ let output = repl_session.evaluate_line_and_get_output(&eval).await;
// only output errors
if let EvaluationOutput::Error(error_text) = output {
println!("Error in --eval flag: {}", error_text);
@@ -156,7 +156,7 @@ pub async fn run(flags: Flags, repl_flags: ReplFlags) -> Result<i32, AnyError> {
Ok(line) => {
should_exit_on_interrupt = false;
editor.update_history(line.clone());
- let output = repl_session.evaluate_line_and_get_output(&line).await?;
+ let output = repl_session.evaluate_line_and_get_output(&line).await;
// We check for close and break here instead of making it a loop condition to get
// consistent behavior in when the user evaluates a call to close().