diff options
Diffstat (limited to 'cli/repl.rs')
-rw-r--r-- | cli/repl.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/cli/repl.rs b/cli/repl.rs index 2e41b0565..be887e941 100644 --- a/cli/repl.rs +++ b/cli/repl.rs @@ -391,16 +391,13 @@ pub async fn run( let inspect_result = inspect_response.get("result").unwrap(); - match evaluate_exception_details { - Some(_) => eprintln!( - "Uncaught {}", - inspect_result.get("value").unwrap().as_str().unwrap() - ), - None => println!( - "{}", - inspect_result.get("value").unwrap().as_str().unwrap() - ), - } + let value = inspect_result.get("value").unwrap().as_str().unwrap(); + let output = match evaluate_exception_details { + Some(_) => format!("Uncaught {}", value), + None => value.to_string(), + }; + + println!("{}", output); editor.lock().unwrap().add_history_entry(line.as_str()); } |