From be0ef63ad467a7efbbecb92d40d1f73af82a0d84 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 30 Oct 2026 22:41:28 +0900 Subject: internal/rosa/azalea: use expr text for errors This is significantly more readable and helpful than simply using the %#v verb. Signed-off-by: Ophestra --- internal/rosa/azalea/evaluate.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/rosa/azalea/evaluate.go b/internal/rosa/azalea/evaluate.go index 3b55f863..9b119100 100644 --- a/internal/rosa/azalea/evaluate.go +++ b/internal/rosa/azalea/evaluate.go @@ -223,7 +223,12 @@ func (e EvaluationError) Unwrap() error { return e.Err } // Error returns a very long error description that should not be presented // to the user directly. func (e EvaluationError) Error() string { - return fmt.Sprintf("expression %#v: %v", e.Expr, e.Err) + v, ok := errors.AsType[EvaluationError](e.Err) + if ok { + return fmt.Sprintf("%v\n%s", v, ExprText(e.Expr)) + } + + return fmt.Sprintf("%v\n\n%s", e.Err, ExprText(e.Expr)) } var ( -- cgit v1.3.1