Skip to content

Commit 20033b1

Browse files
authored
Merge pull request #188 from replicatedhq/laverya/improve-unexpected-operator-error
include the operator in the 'unexpected operator' error message
2 parents fa84d3f + f795f90 commit 20033b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/analyze/text_analyze.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package analyzer
22

33
import (
4+
"fmt"
45
"path/filepath"
56
"regexp"
67
"strconv"
@@ -215,7 +216,7 @@ func compareRegex(conditional string, foundMatches map[string]string) (bool, err
215216
} else {
216217
// all we can support is "=" and "==" and "===" for now
217218
if operator != "=" && operator != "==" && operator != "===" {
218-
return false, errors.New("unexpected operator in regex comparator")
219+
return false, fmt.Errorf("unexpected operator %q in regex comparator, cannot compare %q and %q", operator, foundValue, lookForValue)
219220
}
220221

221222
return foundValue == lookForValue, nil

0 commit comments

Comments
 (0)