From 8dd2920fca5991454b4266a510ee807f7dfbc3f9 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 15 Sep 2025 00:20:05 -0400 Subject: [PATCH] cl-repl/cli: Pretty-print errors in non-repl mode --- compiler/cl-repl/src/cli.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/cl-repl/src/cli.rs b/compiler/cl-repl/src/cli.rs index d177ad0..6aa1d7a 100644 --- a/compiler/cl-repl/src/cli.rs +++ b/compiler/cl-repl/src/cli.rs @@ -171,9 +171,10 @@ fn run_code(path: &str, code: &str, env: &mut Environment) -> Result<(), Box println!("{ret}"), } if env.get("main".into()).is_ok() { - match env.call("main".into(), &[])? { - ConValue::Empty => {} - ret => println!("{ret}"), + match env.call("main".into(), &[]) { + Ok(ConValue::Empty) => {} + Ok(ret) => println!("{ret}"), + Err(e) => println!("Error: {e}"), } } Ok(())