@@ -19,26 +19,12 @@ class GeoIP2Error(RuntimeError):
1919
2020
2121class AddressNotFoundError (GeoIP2Error ):
22- """The address you were looking up was not found.
23-
24- .. attribute:: ip_address
25-
26- The IP address used in the lookup. This is only available for database
27- lookups.
28-
29- :type: str
30-
31- .. attribute:: network
32-
33- The network associated with the error. In particular, this is the
34- largest network where no address would be found. This is only
35- available for database lookups.
36-
37- :type: ipaddress.IPv4Network or ipaddress.IPv6Network
38-
39- """
22+ """The address you were looking up was not found."""
4023
4124 ip_address : Optional [str ]
25+ """The IP address used in the lookup. This is only available for database
26+ lookups.
27+ """
4228 _prefix_len : Optional [int ]
4329
4430 def __init__ (
@@ -53,7 +39,11 @@ def __init__(
5339
5440 @property
5541 def network (self ) -> Optional [Union [ipaddress .IPv4Network , ipaddress .IPv6Network ]]:
56- """The network for the error."""
42+ """The network associated with the error.
43+
44+ In particular, this is the largest network where no address would be
45+ found. This is only available for database lookups.
46+ """
5747 if self .ip_address is None or self ._prefix_len is None :
5848 return None
5949 return ipaddress .ip_network (f"{ self .ip_address } /{ self ._prefix_len } " , False )
@@ -69,12 +59,15 @@ class HTTPError(GeoIP2Error):
6959 This class represents an HTTP transport error. It extends
7060 :py:exc:`GeoIP2Error` and adds attributes of its own.
7161
72- :ivar http_status: The HTTP status code returned
73- :ivar uri: The URI queried
74- :ivar decoded_content: The decoded response content
75-
7662 """
7763
64+ http_status : Optional [int ]
65+ """The HTTP status code returned"""
66+ uri : Optional [str ]
67+ """The URI queried"""
68+ decoded_content : Optional [str ]
69+ """The decoded response content"""
70+
7871 def __init__ (
7972 self ,
8073 message : str ,
0 commit comments