| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
""" |
|---|
| 6 |
Exception class definitions for Twisted Names. |
|---|
| 7 |
""" |
|---|
| 8 |
|
|---|
| 9 |
from twisted.internet.defer import TimeoutError |
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
class DomainError(ValueError): |
|---|
| 13 |
""" |
|---|
| 14 |
Indicates a lookup failed because there were no records matching the given |
|---|
| 15 |
C{name, class, type} triple. |
|---|
| 16 |
""" |
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
class AuthoritativeDomainError(ValueError): |
|---|
| 21 |
""" |
|---|
| 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} |
|---|
| 24 |
triple. |
|---|
| 25 |
""" |
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
class DNSQueryTimeoutError(TimeoutError): |
|---|
| 30 |
""" |
|---|
| 31 |
Indicates a lookup failed due to a timeout. |
|---|
| 32 |
|
|---|
| 33 |
@ivar id: The id of the message which timed out. |
|---|
| 34 |
""" |
|---|
| 35 |
def __init__(self, id): |
|---|
| 36 |
TimeoutError.__init__(self) |
|---|
| 37 |
self.id = id |
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
class DNSFormatError(DomainError): |
|---|
| 42 |
""" |
|---|
| 43 |
Indicates a query failed with a result of L{twisted.names.dns.EFORMAT}. |
|---|
| 44 |
""" |
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
class DNSServerError(DomainError): |
|---|
| 49 |
""" |
|---|
| 50 |
Indicates a query failed with a result of L{twisted.names.dns.ESERVER}. |
|---|
| 51 |
""" |
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
class DNSNameError(DomainError): |
|---|
| 56 |
""" |
|---|
| 57 |
Indicates a query failed with a result of L{twisted.names.dns.ENAME}. |
|---|
| 58 |
""" |
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
class DNSNotImplementedError(DomainError): |
|---|
| 63 |
""" |
|---|
| 64 |
Indicates a query failed with a result of L{twisted.names.dns.ENOTIMP}. |
|---|
| 65 |
""" |
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
class DNSQueryRefusedError(DomainError): |
|---|
| 70 |
""" |
|---|
| 71 |
Indicates a query failed with a result of L{twisted.names.dns.EREFUSED}. |
|---|
| 72 |
""" |
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 |
class DNSUnknownError(DomainError): |
|---|
| 77 |
""" |
|---|
| 78 |
Indicates a query failed with an unknown result. |
|---|
| 79 |
""" |
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 |
__all__ = [ |
|---|
| 84 |
'DomainError', 'AuthoritativeDomainError', 'DNSQueryTimeoutError', |
|---|
| 85 |
|
|---|
| 86 |
'DNSFormatError', 'DNSServerError', 'DNSNameError', |
|---|
| 87 |
'DNSNotImplementedError', 'DNSQueryRefusedError', |
|---|
| 88 |
'DNSUnknownError'] |
|---|