From 88d0ccbf69e064269d170116917558b9b9464539 Mon Sep 17 00:00:00 2001 From: David Mak Date: Thu, 3 Oct 2024 12:49:07 +0800 Subject: [PATCH] [standalone] Explicit panic when encountering a compilation error Otherwise scripts will continue to execute. --- nac3standalone/src/main.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nac3standalone/src/main.rs b/nac3standalone/src/main.rs index 839857093..029021879 100644 --- a/nac3standalone/src/main.rs +++ b/nac3standalone/src/main.rs @@ -297,8 +297,7 @@ fn main() { let program = match fs::read_to_string(file_name.clone()) { Ok(program) => program, Err(err) => { - println!("Cannot open input file: {err}"); - return; + panic!("Cannot open input file: {err}"); } }; @@ -340,8 +339,7 @@ fn main() { unifier, primitives, ) { - eprintln!("{err}"); - return; + panic!("{err}"); } } // allow (and ignore) "from __future__ import annotations"