check / check (push) Failing after 2m25s
ResolveIPAddresses now returns an error wrapping ErrNoNameserverAnswered when every nameserver of the name's zone timed out or failed, instead of no addresses and no error. It reads each nameserver's status as the lookup already sets it; one answer, even NXDOMAIN, is enough for an empty result without an error. The only caller, the nameserver address lookup, already keeps the previous addresses on an error; its comment no longer says the resolver hides this case. Model: opus-5-5
28 lines
783 B
Go
28 lines
783 B
Go
package resolver
|
|
|
|
import "errors"
|
|
|
|
// Sentinel errors returned by the resolver.
|
|
var (
|
|
// ErrNoNameservers is returned when no authoritative NS
|
|
// could be discovered for a domain.
|
|
ErrNoNameservers = errors.New(
|
|
"no authoritative nameservers found",
|
|
)
|
|
|
|
// ErrNoNameserverAnswered is returned when every nameserver
|
|
// asked about a name timed out or failed, so whether the name
|
|
// has addresses is unknown.
|
|
ErrNoNameserverAnswered = errors.New("no nameserver answered")
|
|
|
|
// ErrCNAMEDepthExceeded is returned when a CNAME chain
|
|
// exceeds MaxCNAMEDepth.
|
|
ErrCNAMEDepthExceeded = errors.New(
|
|
"CNAME chain depth exceeded",
|
|
)
|
|
|
|
// ErrContextCanceled wraps context cancellation for the
|
|
// resolver's iterative queries.
|
|
ErrContextCanceled = errors.New("context canceled")
|
|
)
|