aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/azalea/evaluate.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-10-30 22:41:28 +0900
committerOphestra <cat@gensokyo.uk>2026-10-30 22:41:28 +0900
commitbe0ef63ad467a7efbbecb92d40d1f73af82a0d84 (patch)
tree8dd26e1180e99ac2db33b34a844e1a0e37d26b3b /internal/rosa/azalea/evaluate.go
parent1b9124e88ab86e8a91384066cd96adbdfcf8bc4a (diff)
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 <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/azalea/evaluate.go')
-rw-r--r--internal/rosa/azalea/evaluate.go7
1 files changed, 6 insertions, 1 deletions
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 (