| Copyright | (c) Viktor Dukhovni 2026 |
|---|---|
| License | BSD-3-Clause |
| Maintainer | ietf-dane@dukhovni.org |
| Stability | unstable |
| Safe Haskell | None |
| Language | GHC2024 |
Net.DNSBase.Error
Description
DNSError is the sum type returned by all failed lookups in
Net.DNSBase.Lookup. Its constructors split by source: network
problems (NetworkError), protocol-level decode or response-code
failures (ProtocolError), API misuse errors (UserError), and
so on. Information about the context in which the error occured
is included when available. EncodeErr is the analogous sum
returned by failures of the wire-form encoder.
Synopsis
- data DNSError
- data DnsXprt where
- pattern DnsOverQUIC :: DnsXprt
- pattern DnsOverTCP :: DnsXprt
- pattern DnsOverTLS :: DnsXprt
- pattern DnsOverUDP :: DnsXprt
- data EncodeErr r where
- EncodeTooLong :: forall r. (Typeable r, Show r, Eq r) => r -> EncodeErr r
- CantEncode :: forall r. (Typeable r, Show r, Eq r) => r -> EncodeErr r
- ReservedType :: forall r. (Typeable r, Show r, Eq r) => RRTYPE -> r -> EncodeErr r
- EDNSRequired :: forall r. EncodeErr r
- data NetworkContext
- data ProtocolContext
- data UserContext
- data DecodeContext = DecodeContext {}
- data EncodeContext = (Typeable r, Show r, Eq r) => EncodeContext (EncodeErr r)
- data DnsSection
- data MessageSource = MessageSource {}
Documentation
DNS API errors.
Constructors
| BadConfiguration String | Resolver misconfiguration. |
| BadNameserver IOException | Nameserver name -> address lookup failure. |
| DecodeError DecodeContext String | Error while decoding from wire form. |
| EncodeError EncodeContext | Error while encoding to wire form. |
| InvalidDomain String | Invalid domain name presentation form. |
| NetworkError NetworkContext | Error in connection establishment, data transmission or a timeout. |
| ProtocolError ProtocolContext | Unexpected DNS message. |
| ResponseError RCODE | DNS message indicates a remote error condition. |
| UserError UserContext | Invalid request. |
Instances
| Exception DNSError Source # | |
Defined in Net.DNSBase.Internal.Error Methods toException :: DNSError -> SomeException # fromException :: SomeException -> Maybe DNSError # displayException :: DNSError -> String # backtraceDesired :: DNSError -> Bool # | |
| Show DNSError Source # | |
| Eq DNSError Source # | |
Transport between DNS client and server
Bundled Patterns
| pattern DnsOverQUIC :: DnsXprt | |
| pattern DnsOverTCP :: DnsXprt | |
| pattern DnsOverTLS :: DnsXprt | |
| pattern DnsOverUDP :: DnsXprt |
Instances
| Presentable DnsXprt Source # | |
Defined in Net.DNSBase.Internal.Peer Methods present :: DnsXprt -> Builder -> Builder Source # presentLazy :: DnsXprt -> ByteString -> ByteString Source # | |
| Bounded DnsXprt Source # | |
| Enum DnsXprt Source # | |
| Num DnsXprt Source # | |
| Integral DnsXprt Source # | |
Defined in Net.DNSBase.Internal.Peer | |
| Real DnsXprt Source # | |
Defined in Net.DNSBase.Internal.Peer Methods toRational :: DnsXprt -> Rational # | |
| Eq DnsXprt Source # | |
| Ord DnsXprt Source # | |
Defined in Net.DNSBase.Internal.Peer | |
data EncodeErr r where Source #
Encoding error, polymorphic over the context type
Constructors
| EncodeTooLong :: forall r. (Typeable r, Show r, Eq r) => r -> EncodeErr r | message or field too long |
| CantEncode :: forall r. (Typeable r, Show r, Eq r) => r -> EncodeErr r | Invalid input |
| ReservedType :: forall r. (Typeable r, Show r, Eq r) => RRTYPE -> r -> EncodeErr r | Unencodable reserved type |
| EDNSRequired :: forall r. EncodeErr r | RCODE or flags require EDNS |
data NetworkContext Source #
Constructors
| RetryLimitExceeded | The number of retries for the request was exceeded. |
| TimeoutExpired | TCP fallback request timed out. |
| NetworkFailure IOException | Network failure. |
| ServerFailure |
Instances
| Show NetworkContext Source # | |
Defined in Net.DNSBase.Internal.Error Methods showsPrec :: Int -> NetworkContext -> ShowS # show :: NetworkContext -> String # showList :: [NetworkContext] -> ShowS # | |
| Eq NetworkContext Source # | |
Defined in Net.DNSBase.Internal.Error Methods (==) :: NetworkContext -> NetworkContext -> Bool # (/=) :: NetworkContext -> NetworkContext -> Bool # | |
data ProtocolContext Source #
Constructors
| SequenceNumberMismatch | The question section of the response doesn't match our query. This could indicate foul play. |
| QuestionMismatch |
Instances
| Show ProtocolContext Source # | |
Defined in Net.DNSBase.Internal.Error Methods showsPrec :: Int -> ProtocolContext -> ShowS # show :: ProtocolContext -> String # showList :: [ProtocolContext] -> ShowS # | |
| Eq ProtocolContext Source # | |
Defined in Net.DNSBase.Internal.Error Methods (==) :: ProtocolContext -> ProtocolContext -> Bool # (/=) :: ProtocolContext -> ProtocolContext -> Bool # | |
data UserContext Source #
Constructors
| InvalidQueryType RRTYPE | The RRTYPE requested is invalid for queries. |
| IllegalDomain String | The domain for query is illegal. |
| BadResponseQuestionCount Int | The response message question count is not equal to 1. |
Instances
| Show UserContext Source # | |
Defined in Net.DNSBase.Internal.Error Methods showsPrec :: Int -> UserContext -> ShowS # show :: UserContext -> String # showList :: [UserContext] -> ShowS # | |
| Eq UserContext Source # | |
Defined in Net.DNSBase.Internal.Error | |
data DecodeContext Source #
Request or response context in which a failure occurred. The
decodeTriple holds the name, class and type of the problem RR, provided
the error was not in one of those fields.
Constructors
| DecodeContext | |
Fields | |
Instances
| Presentable DecodeContext Source # | |
Defined in Net.DNSBase.Internal.Error Methods present :: DecodeContext -> Builder -> Builder Source # presentLazy :: DecodeContext -> ByteString -> ByteString Source # | |
| Eq DecodeContext Source # | |
Defined in Net.DNSBase.Internal.Error Methods (==) :: DecodeContext -> DecodeContext -> Bool # (/=) :: DecodeContext -> DecodeContext -> Bool # | |
data EncodeContext Source #
Constructors
| (Typeable r, Show r, Eq r) => EncodeContext (EncodeErr r) |
Instances
| Show EncodeContext Source # | |
Defined in Net.DNSBase.Internal.Error Methods showsPrec :: Int -> EncodeContext -> ShowS # show :: EncodeContext -> String # showList :: [EncodeContext] -> ShowS # | |
| Eq EncodeContext Source # | |
Defined in Net.DNSBase.Internal.Error Methods (==) :: EncodeContext -> EncodeContext -> Bool # (/=) :: EncodeContext -> EncodeContext -> Bool # | |
data DnsSection Source #
Message section for error reporting. The message header and EDNS OPT
record are also considered sections in this context.
Constructors
| DnsHeaderSection | While parsing the message header. |
| DnsQuestionSection | While parsing the question section. |
| DnsAnswerSection | While parsing the answer section. |
| DnsAuthoritySection | While parsing the authority section. |
| DnsAdditionalSection | While parsing the additional section. |
| DnsEDNSSection | While parsing the EDNS OPT record. |
| DnsNonSection | While parsing a wire-form message fragment. |
Instances
| Presentable DnsSection Source # | |
Defined in Net.DNSBase.Internal.Error Methods present :: DnsSection -> Builder -> Builder Source # presentLazy :: DnsSection -> ByteString -> ByteString Source # | |
| Show DnsSection Source # | |
Defined in Net.DNSBase.Internal.Error Methods showsPrec :: Int -> DnsSection -> ShowS # show :: DnsSection -> String # showList :: [DnsSection] -> ShowS # | |
| Eq DnsSection Source # | |
Defined in Net.DNSBase.Internal.Error | |
data MessageSource Source #
DNS client or server peer endpoint.
Constructors
| MessageSource | |
Fields
| |
Instances
| Presentable MessageSource Source # | |
Defined in Net.DNSBase.Internal.Peer Methods present :: MessageSource -> Builder -> Builder Source # presentLazy :: MessageSource -> ByteString -> ByteString Source # | |
| Eq MessageSource Source # | |
Defined in Net.DNSBase.Internal.Peer Methods (==) :: MessageSource -> MessageSource -> Bool # (/=) :: MessageSource -> MessageSource -> Bool # | |