Skip to content

Commit

Permalink
chore: better error message on change mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Oct 1, 2024
1 parent 1d2ac59 commit 77ce53d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scrapers/changes/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/flanksource/commons/logger"
v1 "github.com/flanksource/config-db/api/v1"
"github.com/flanksource/gomplate/v3"
"github.com/samber/lo"
"github.com/samber/oops"
"gopkg.in/yaml.v3"
)
Expand Down Expand Up @@ -43,7 +44,7 @@ func (t *changeRule) process(change *v1.ChangeResult) error {
}

if ok, err := evaluateCelExpression(t.Rule, env); err != nil {
return fmt.Errorf("failed to evaluate rule: %w", err)
return fmt.Errorf("failed to evaluate rule (%s): %w", lo.Elipse(t.Rule, 30), err)
} else if !ok {
return nil
}
Expand Down

0 comments on commit 77ce53d

Please sign in to comment.