From f7357d44987b4d3eeaf9415e52d018d02b4525c2 Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 21 Oct 2019 03:25:45 -0700 Subject: [PATCH] Add explicit panic for prelude errors Maybe I want to handle this better in the future, but for now just panic if the prelude is bad for some reason. --- schala-lang/language/src/schala.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/schala-lang/language/src/schala.rs b/schala-lang/language/src/schala.rs index 9d5bc51..9516506 100644 --- a/schala-lang/language/src/schala.rs +++ b/schala-lang/language/src/schala.rs @@ -51,7 +51,10 @@ impl Schala { let mut s = Schala::new_blank_env(); let request = ComputationRequest { source: prelude, debug_requests: HashSet::default() }; - s.run_computation(request); + let response = s.run_computation(request); + if let Err(msg) = response.main_output { + panic!("Error in prelude, panicking: {}", msg); + } s }