From ee0657c2929a77d58dc9f37381c3f0c044ff2d64 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 4 Oct 2022 12:29:02 +0300 Subject: fix(tvix/eval): forward thunk error codes from inner errors Until we can display a chained representatino of errors in thunks, it is most useful to forward the error code from the innermost error to the user. Change-Id: I8d67254d52313be40387f080e57966c001e0d51c Reviewed-on: https://cl.tvl.fyi/c/depot/+/6854 Reviewed-by: sterni Autosubmit: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/errors.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tvix/eval/src/errors.rs') diff --git a/tvix/eval/src/errors.rs b/tvix/eval/src/errors.rs index 1776cef88b..b3b45c6cee 100644 --- a/tvix/eval/src/errors.rs +++ b/tvix/eval/src/errors.rs @@ -291,7 +291,6 @@ to a missing value in the attribute set(s) included via `with`."#, ErrorKind::InfiniteRecursion => "E014", ErrorKind::ParseErrors(_) => "E015", ErrorKind::DuplicateAttrsKey { .. } => "E016", - ErrorKind::ThunkForce(_) => "E017", ErrorKind::NotCoercibleToString { .. } => "E018", ErrorKind::IndexOutOfBounds { .. } => "E019", ErrorKind::NotAnAbsolutePath(_) => "E020", @@ -301,6 +300,13 @@ to a missing value in the attribute set(s) included via `with`."#, ErrorKind::UnmergeableInherit { .. } => "E024", ErrorKind::UnmergeableValue => "E025", ErrorKind::NotImplemented(_) => "E999", + + // TODO: thunk force errors should yield a chained + // diagnostic, but until then we just forward the error + // code from the inner error. + // + // The error code for thunk forces is E017. + ErrorKind::ThunkForce(ref err) => err.code(), } } -- cgit 1.4.1