1 # -*- test-case-name: twisted.names.test -*-
2 # Copyright (c) Twisted Matrix Laboratories.
3 # See LICENSE for details.
6 Exception class definitions for Twisted Names.
9 from twisted.internet.defer import TimeoutError
12 class DomainError(ValueError):
14 Indicates a lookup failed because there were no records matching the given
15 C{name, class, type} triple.
20 class AuthoritativeDomainError(ValueError):
22 Indicates a lookup failed for a name for which this server is authoritative
23 because there were no records matching the given C{name, class, type}
29 class DNSQueryTimeoutError(TimeoutError):
31 Indicates a lookup failed due to a timeout.
33 @ivar id: The id of the message which timed out.
35 def __init__(self, id):
36 TimeoutError.__init__(self)
41 class DNSFormatError(DomainError):
43 Indicates a query failed with a result of L{twisted.names.dns.EFORMAT}.
48 class DNSServerError(DomainError):
50 Indicates a query failed with a result of L{twisted.names.dns.ESERVER}.
55 class DNSNameError(DomainError):
57 Indicates a query failed with a result of L{twisted.names.dns.ENAME}.
62 class DNSNotImplementedError(DomainError):
64 Indicates a query failed with a result of L{twisted.names.dns.ENOTIMP}.
69 class DNSQueryRefusedError(DomainError):
71 Indicates a query failed with a result of L{twisted.names.dns.EREFUSED}.
76 class DNSUnknownError(DomainError):
78 Indicates a query failed with an unknown result.
83 class ResolverError(Exception):
85 Indicates a query failed because of a decision made by the local
91 'DomainError', 'AuthoritativeDomainError', 'DNSQueryTimeoutError',
93 'DNSFormatError', 'DNSServerError', 'DNSNameError',
94 'DNSNotImplementedError', 'DNSQueryRefusedError',
95 'DNSUnknownError', 'ResolverError']