about summary refs log tree commit diff
path: root/tvix/eval/src/eval.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-26T21·20+0300
committertazjin <tazjin@tvl.su>2022-09-03T21·55+0000
commite4fadfaaf8b7e821b77ce4dc41b915ff83f8e240 (patch)
tree449f9fbfc5e311b993d8aef7253008d9a9ae461e /tvix/eval/src/eval.rs
parent1163ef3e413d239282b8a5fc24b708ee62c6f6a7 (diff)
chore(tvix/eval): print node representation for compiler errors r/4624
Better for development flow.

Change-Id: I038efb39caca804f28a44fd4c83457e90abbcee4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6290
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
Diffstat (limited to 'tvix/eval/src/eval.rs')
-rw-r--r--tvix/eval/src/eval.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/tvix/eval/src/eval.rs b/tvix/eval/src/eval.rs
index add621af6c..d61e51e6af 100644
--- a/tvix/eval/src/eval.rs
+++ b/tvix/eval/src/eval.rs
@@ -42,7 +42,11 @@ pub fn interpret(code: &str, location: Option<PathBuf>) -> EvalResult<Value> {
     }
 
     for error in &result.errors {
-        eprintln!("compiler error: {:?} at {:?}", error.kind, error.node,);
+        eprintln!(
+            "compiler error: {:?} at {:?}",
+            error.kind,
+            error.node.as_ref().map(|node| node.text())
+        );
     }
 
     if let Some(err) = result.errors.last() {