Documentation ¶
Overview ¶
Package errors aids error handling for dns.Msg and darvaza.org/resolver related functions
Index ¶
- Constants
- Variables
- func ErrBadRequest() *net.DNSError
- func ErrBadResponse() *net.DNSError
- func ErrInternalError(name, server string) *net.DNSError
- func ErrNotFound(qName string) *net.DNSError
- func ErrNotImplemented(name string) *net.DNSError
- func ErrRefused(name string) *net.DNSError
- func ErrTimeout(qName string, err error) *net.DNSError
- func ErrTimeoutMessage(qName string, msg string) *net.DNSError
- func ErrTypeNotFound(qName string) *net.DNSError
- func ErrorAsMsg(req *dns.Msg, err error) *dns.Msg
- func IsNotFound(err error) bool
- func IsTemporary(err error) bool
- func IsTimeout(err error) bool
- func MsgAsError(r *dns.Msg) *net.DNSError
- func New(s string) error
- func ValidateResponse(server string, r *dns.Msg, err error) *net.DNSError
Constants ¶
const ( // NOANSWER is the text on [net.DNSError].Err if no [dns.Msg] was returned NOANSWER = "no answer" // NODATA is the text on [net.DNSError].Err if an authoritative server // returned no answer NODATA = "NODATA" // NXDOMAIN is the text on [net.DNSError].Err if the server returned a // Name error NXDOMAIN = "NXDOMAIN" // TRUNCATED is the text on [net.DNSError].Err if the server returned a // truncated response TRUNCATED = "dns response was truncated" // BADREQUEST is the text on [net.DNSError].Err if the client request // is invalid BADREQUEST = "invalid dns request" // BADRESPONSE is the text on [net.DNSError].Err if the server response // in invalid BADRESPONSE = "invalid dns response from server" // NOTIMPLEMENTED is the text on [net.DNSError].Err if the requested // functionality isn't implemented by the server NOTIMPLEMENTED = "feature not implemented by the server" )
Variables ¶
var ( // CANCELLED indicates the context the exchange was using was // cancelled. CANCELLED = context.Canceled.Error() // DEADLINEEXCEEDED indicates the deadline the exchange was given // has been exceeded. DEADLINEEXCEEDED = context.DeadlineExceeded.Error() )
Functions ¶
func ErrBadRequest ¶ added in v0.6.3
ErrBadRequest reports an invalid request from the client
func ErrBadResponse ¶
ErrBadResponse reports a bad response from the server
func ErrInternalError ¶ added in v0.7.24
ErrInternalError reports there was a failure on our side.
func ErrNotFound ¶
ErrNotFound assembles a net.DNSError indicating the asked name doesn't exist.
func ErrNotImplemented ¶
ErrNotImplemented reports something isn't implemented
func ErrRefused ¶ added in v0.7.24
ErrRefused reports we can't answer
func ErrTimeout ¶
ErrTimeout assembles a Timeout() error
func ErrTimeoutMessage ¶
ErrTimeoutMessage is a variant of ErrTimeout that uses a given message instead of wrapping an error
func ErrTypeNotFound ¶ added in v0.7.5
ErrTypeNotFound assembles a net.DNSError indicating the name exists but not the requested qType/qClass.
func ErrorAsMsg ¶ added in v0.6.3
ErrorAsMsg attempts to convert a net.DNSError into a dns.Msg response
func IsNotFound ¶
IsNotFound checks if the given error represents a NotFound
func IsTemporary ¶
IsTemporary checks if the given error could be rechecked
func MsgAsError ¶
MsgAsError validates a response and produces a matching net.DNSError if due.
func ValidateResponse ¶
ValidateResponse analyses a dns.Exchange response and produces a matching net.DNSError if it's an error
Types ¶
This section is empty.