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 <sternenseemann@systemli.org>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2022-10-04 12:29:02 +03:00 committed by clbot
parent 89dc26cece
commit ee0657c292

View file

@ -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(),
}
}