From bd0fc69f0702d5682ea7fcba6c39a7dc09891368 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 24 Aug 2022 17:13:00 +0300 Subject: feat(tvix/eval): implement 'throw' and 'abort' builtins These do essentially the same, but return different error variants as upstream Nix considers `throw` to be (sometimes) catchable. Change-Id: I1a9ea84567d46fb37287dbf3f3f67052f9382cca Reviewed-on: https://cl.tvl.fyi/c/depot/+/6259 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/errors.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tvix/eval/src/errors.rs') diff --git a/tvix/eval/src/errors.rs b/tvix/eval/src/errors.rs index a2fbdf02d1..96217cabaf 100644 --- a/tvix/eval/src/errors.rs +++ b/tvix/eval/src/errors.rs @@ -38,6 +38,10 @@ pub enum ErrorKind { ParseErrors(Vec), AssertionFailed, + + // These are user-generated errors through builtins. + Throw(String), + Abort(String), } #[derive(Clone, Debug)] -- cgit 1.4.1