Skip to content

Commit

Permalink
change dsl evaluate warning messages to error (#2096)
Browse files Browse the repository at this point in the history
* change dsl evaluate warning messages to error

* add template-id to dsl match error logs
  • Loading branch information
parrasajad committed Jun 3, 2022
1 parent fa369b7 commit b79817e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions v2/pkg/operators/matchers/match.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ func (matcher *Matcher) MatchDSL(data map[string]interface{}) bool {

result, err := expression.Evaluate(data)
if err != nil {
gologger.Warning().Msgf(err.Error())
gologger.Error().Label("WRN").Msgf("[%s] %s", data["template-id"], err.Error())
continue
}

if boolResult, ok := result.(bool); !ok {
gologger.Warning().Msgf("The return value of a DSL statement must return a boolean value.")
gologger.Error().Label("WRN").Msgf("[%s] The return value of a DSL statement must return a boolean value.", data["template-id"])
continue
} else if !boolResult {
// If we are in an AND request and a match failed,
Expand Down

0 comments on commit b79817e

Please sign in to comment.