--- a/crates/jrsonnet-evaluator/src/evaluate.rs +++ b/crates/jrsonnet-evaluator/src/evaluate.rs @@ -555,10 +555,18 @@ )?; if assertion_result { evaluate(context, returned)? - } else if let Some(msg) = msg { - throw!(AssertionFailed(evaluate(context, msg)?.to_string()?)); } else { - throw!(AssertionFailed(Val::Null.to_string()?)); + push( + &value.1, + || "assertion failure".to_owned(), + || { + if let Some(msg) = msg { + throw!(AssertionFailed(evaluate(context, msg)?.to_string()?)); + } else { + throw!(AssertionFailed(Val::Null.to_string()?)); + } + }, + )? } } ErrorStmt(e) => push(