propagate error when adding domain condition

pull/1524/head^2
Darien Raymond 2018-07-17 17:53:24 +02:00
parent c52310cf54
commit ecd45ffb65
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 3 additions and 1 deletions

View File

@ -54,7 +54,9 @@ func (rr *RoutingRule) BuildCondition() (Condition, error) {
if len(rr.Domain) > 0 {
matcher := NewCachableDomainMatcher()
for _, domain := range rr.Domain {
matcher.Add(domain)
if err := matcher.Add(domain); err != nil {
return nil, newError("failed to build domain condition").Base(err)
}
}
conds.Add(matcher)
}