about summary refs log tree commit diff
path: root/tvix/eval/src/compiler
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2023-09-09T07·10-0700
committerclbot <clbot@tvl.fyi>2023-09-24T21·54+0000
commit926459ce694536432c36d8f0d3fb25b821945852 (patch)
tree2c5509c92afec80b281f82761f19ee192a85851a /tvix/eval/src/compiler
parent6015604bd81e064da8253c58825315a3b8e47b30 (diff)
refactor(tvix/eval): factor CatchableErrorKind out of ErrorKind r/6649
This commit creates a separate enum for "catchable" errors (the kind
that `builtins.tryEval` can detect).

Change-Id: Ie81d1112526d852255d9842f67045f88eab192af
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9287
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: Adam Joseph <adam@westernsemico.com>
Diffstat (limited to 'tvix/eval/src/compiler')
-rw-r--r--tvix/eval/src/compiler/mod.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs
index 3ab0e4d933..5c2825507f 100644
--- a/tvix/eval/src/compiler/mod.rs
+++ b/tvix/eval/src/compiler/mod.rs
@@ -27,7 +27,7 @@ use std::rc::{Rc, Weak};
 use std::sync::Arc;
 
 use crate::chunk::Chunk;
-use crate::errors::{Error, ErrorKind, EvalResult};
+use crate::errors::{CatchableErrorKind, Error, ErrorKind, EvalResult};
 use crate::observer::CompilerObserver;
 use crate::opcode::{CodeIdx, ConstantIdx, Count, JumpOffset, OpCode, UpvalueIdx};
 use crate::spans::LightSpan;
@@ -398,7 +398,9 @@ impl Compiler<'_> {
             if raw_path.len() == 2 {
                 return self.emit_error(
                     node,
-                    ErrorKind::NixPathResolution("Empty <> path not allowed".into()),
+                    ErrorKind::CatchableErrorKind(CatchableErrorKind::NixPathResolution(
+                        "Empty <> path not allowed".into(),
+                    )),
                 );
             }
             let path = &raw_path[1..(raw_path.len() - 1)];