Some checks failed
Check / check (pull_request) Failing after 6m4s
- Add StatusTimeout constant for timeout responses - querySingleType now retries on timeout and SERVFAIL (3 attempts, exponential backoff starting at 100ms) - NXDOMAIN and NOERROR+empty are treated as authoritative negatives with no retry - classifyResponse sets structured error messages for timeout and SERVFAIL cases - Refactored into smaller functions to satisfy cyclomatic complexity limits
32 lines
847 B
Go
32 lines
847 B
Go
package resolver
|
|
|
|
import "errors"
|
|
|
|
// Sentinel errors returned by the resolver.
|
|
var (
|
|
// ErrNotImplemented indicates a method is stubbed out.
|
|
ErrNotImplemented = errors.New(
|
|
"resolver not yet implemented",
|
|
)
|
|
|
|
// ErrNoNameservers is returned when no authoritative NS
|
|
// could be discovered for a domain.
|
|
ErrNoNameservers = errors.New(
|
|
"no authoritative nameservers found",
|
|
)
|
|
|
|
// 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")
|
|
|
|
// ErrSERVFAIL is returned when a DNS server responds with
|
|
// SERVFAIL after all retries are exhausted.
|
|
ErrSERVFAIL = errors.New("SERVFAIL from server")
|
|
)
|