Skip to content

Commit

Permalink
proxy: imp docs
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Dec 13, 2023
1 parent f4ac669 commit 14cbbed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions proxy/upstreams.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,13 @@ func ParseUpstreamsConfig(
return p.parse(lines)
}

// ParseError is an error containing an index of a list of upstreams.
// ParseError is an error which contains an index of the line of the upstream
// list.
type ParseError struct {
// err is the original error.
err error

// Idx is an index of a list of upstreams.
// Idx is an index of the line of the upstream list.
Idx int
}

Expand Down Expand Up @@ -192,7 +193,7 @@ func (p *configParser) parseLine(idx int, confLine string) (err error) {
return nil
}

return errors.Error("not a domain-specific upstream")
return nil
}

for _, u := range upstreams {
Expand Down Expand Up @@ -252,8 +253,7 @@ func (p *configParser) specifyUpstream(
// create an upstream
dnsUpstream, err = upstream.AddressToUpstream(u, p.options.Clone())
if err != nil {
return fmt.Errorf("cannot prepare the upstream %d %q (%s): %s",
idx, confLine, p.options.Bootstrap, err)
return fmt.Errorf("cannot prepare the upstream %d %q: %s", idx, confLine, err)
}

// save to the index
Expand Down

0 comments on commit 14cbbed

Please sign in to comment.