Merge "Fix error message when a select condition isn't handled" into main
This commit is contained in:
commit
65e5724978
1 changed files with 4 additions and 1 deletions
|
@ -467,6 +467,7 @@ func (c *singleConfigurable[T]) evaluateNonTransitive(propertyName string, evalu
|
|||
values[i] = evaluator.EvaluateConfiguration(condition, propertyName)
|
||||
}
|
||||
foundMatch := false
|
||||
nonMatchingIndex := 0
|
||||
var result *T
|
||||
for _, case_ := range c.cases {
|
||||
allMatch := true
|
||||
|
@ -477,6 +478,7 @@ func (c *singleConfigurable[T]) evaluateNonTransitive(propertyName string, evalu
|
|||
}
|
||||
if !pat.matchesValue(values[i]) {
|
||||
allMatch = false
|
||||
nonMatchingIndex = i
|
||||
break
|
||||
}
|
||||
}
|
||||
|
@ -488,7 +490,8 @@ func (c *singleConfigurable[T]) evaluateNonTransitive(propertyName string, evalu
|
|||
if foundMatch {
|
||||
return result
|
||||
}
|
||||
evaluator.PropertyErrorf(propertyName, "%s had value %s, which was not handled by the select statement", c.conditions, values)
|
||||
|
||||
evaluator.PropertyErrorf(propertyName, "%s had value %s, which was not handled by the select statement", c.conditions[nonMatchingIndex].String(), values[nonMatchingIndex].String())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue