feat(tvix/eval): context-aware throw

Change-Id: Ie552dabe4cf93cc396c883268a3bee67796dbbd8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10429
Autosubmit: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
Ryan Lahfa 2023-12-26 00:41:13 +01:00 committed by clbot
parent 7dcb37fc52
commit c7d6d08799

View file

@ -1122,8 +1122,9 @@ mod pure_builtins {
#[builtin("throw")]
async fn builtin_throw(co: GenCo, message: Value) -> Result<Value, ErrorKind> {
// TODO(sterni): coerces to string
// We do not care about the context here explicitly.
Ok(Value::Catchable(CatchableErrorKind::Throw(
message.to_str()?.to_string(),
message.to_contextful_str()?.to_string(),
)))
}