Skip to content

Commit

Permalink
Improve error message for wrong upstream definition #356
Browse files Browse the repository at this point in the history
  • Loading branch information
0xERR0R committed Dec 11, 2021
1 parent 3fa79b4 commit c88ca4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (u *Upstream) UnmarshalYAML(unmarshal func(interface{}) error) error {

upstream, err := ParseUpstream(s)
if err != nil {
return err
return fmt.Errorf("can"t convert upstream "%s": %w", s, err)
}

*u = upstream
Expand All @@ -90,7 +90,7 @@ func (c *ConditionalUpstreamMapping) UnmarshalYAML(unmarshal func(interface{}) e
for _, part := range strings.Split(v, ",") {
upstream, err := ParseUpstream(strings.TrimSpace(part))
if err != nil {
return err
return fmt.Errorf("can"t convert upstream "%s": %w", strings.TrimSpace(part), err)
}

upstreams = append(upstreams, upstream)
Expand Down

0 comments on commit c88ca4a

Please sign in to comment.