Skip to content

Commit 59b07cc

Browse files
horghclaude
andcommitted
Fully qualify exception class names in YARD @raise tags
YARD could not resolve unqualified class names like AddressNotFoundError, rendering them without type information in generated documentation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 23e7051 commit 59b07cc

2 files changed

Lines changed: 69 additions & 57 deletions

File tree

lib/maxmind/geoip2/client.rb

Lines changed: 51 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -132,26 +132,30 @@ def initialize(
132132
#
133133
# @raise [JSON::ParserError] if there was invalid JSON in the response.
134134
#
135-
# @raise [HTTPError] if there was a problem with the HTTP response, such as
136-
# an unexpected HTTP status code.
135+
# @raise [MaxMind::GeoIP2::HTTPError] if there was a problem with the HTTP
136+
# response, such as an unexpected HTTP status code.
137137
#
138-
# @raise [AddressInvalidError] if the web service believes the IP address
139-
# to be invalid or missing.
138+
# @raise [MaxMind::GeoIP2::AddressInvalidError] if the web service believes
139+
# the IP address to be invalid or missing.
140140
#
141-
# @raise [AddressNotFoundError] if the IP address was not found.
141+
# @raise [MaxMind::GeoIP2::AddressNotFoundError] if the IP address was not
142+
# found.
142143
#
143-
# @raise [AddressReservedError] if the IP address is reserved.
144+
# @raise [MaxMind::GeoIP2::AddressReservedError] if the IP address is
145+
# reserved.
144146
#
145-
# @raise [AuthenticationError] if there was a problem authenticating to the
146-
# web service, such as an invalid or missing license key.
147+
# @raise [MaxMind::GeoIP2::AuthenticationError] if there was a problem
148+
# authenticating to the web service, such as an invalid or missing
149+
# license key.
147150
#
148-
# @raise [InsufficientFundsError] if your account is out of credit.
151+
# @raise [MaxMind::GeoIP2::InsufficientFundsError] if your account is out
152+
# of credit.
149153
#
150-
# @raise [PermissionRequiredError] if your account does not have permission
151-
# to use the web service.
154+
# @raise [MaxMind::GeoIP2::PermissionRequiredError] if your account does
155+
# not have permission to use the web service.
152156
#
153-
# @raise [InvalidRequestError] if the web service responded with an error
154-
# and there is no more specific error to raise.
157+
# @raise [MaxMind::GeoIP2::InvalidRequestError] if the web service
158+
# responded with an error and there is no more specific error to raise.
155159
#
156160
# @return [MaxMind::GeoIP2::Model::City]
157161
def city(ip_address = 'me')
@@ -169,26 +173,30 @@ def city(ip_address = 'me')
169173
#
170174
# @raise [JSON::ParserError] if there was invalid JSON in the response.
171175
#
172-
# @raise [HTTPError] if there was a problem with the HTTP response, such as
173-
# an unexpected HTTP status code.
176+
# @raise [MaxMind::GeoIP2::HTTPError] if there was a problem with the HTTP
177+
# response, such as an unexpected HTTP status code.
174178
#
175-
# @raise [AddressInvalidError] if the web service believes the IP address
176-
# to be invalid or missing.
179+
# @raise [MaxMind::GeoIP2::AddressInvalidError] if the web service believes
180+
# the IP address to be invalid or missing.
177181
#
178-
# @raise [AddressNotFoundError] if the IP address was not found.
182+
# @raise [MaxMind::GeoIP2::AddressNotFoundError] if the IP address was not
183+
# found.
179184
#
180-
# @raise [AddressReservedError] if the IP address is reserved.
185+
# @raise [MaxMind::GeoIP2::AddressReservedError] if the IP address is
186+
# reserved.
181187
#
182-
# @raise [AuthenticationError] if there was a problem authenticating to the
183-
# web service, such as an invalid or missing license key.
188+
# @raise [MaxMind::GeoIP2::AuthenticationError] if there was a problem
189+
# authenticating to the web service, such as an invalid or missing
190+
# license key.
184191
#
185-
# @raise [InsufficientFundsError] if your account is out of credit.
192+
# @raise [MaxMind::GeoIP2::InsufficientFundsError] if your account is out
193+
# of credit.
186194
#
187-
# @raise [PermissionRequiredError] if your account does not have permission
188-
# to use the web service.
195+
# @raise [MaxMind::GeoIP2::PermissionRequiredError] if your account does
196+
# not have permission to use the web service.
189197
#
190-
# @raise [InvalidRequestError] if the web service responded with an error
191-
# and there is no more specific error to raise.
198+
# @raise [MaxMind::GeoIP2::InvalidRequestError] if the web service
199+
# responded with an error and there is no more specific error to raise.
192200
#
193201
# @return [MaxMind::GeoIP2::Model::Country]
194202
def country(ip_address = 'me')
@@ -209,26 +217,30 @@ def country(ip_address = 'me')
209217
#
210218
# @raise [JSON::ParserError] if there was invalid JSON in the response.
211219
#
212-
# @raise [HTTPError] if there was a problem with the HTTP response, such as
213-
# an unexpected HTTP status code.
220+
# @raise [MaxMind::GeoIP2::HTTPError] if there was a problem with the HTTP
221+
# response, such as an unexpected HTTP status code.
214222
#
215-
# @raise [AddressInvalidError] if the web service believes the IP address
216-
# to be invalid or missing.
223+
# @raise [MaxMind::GeoIP2::AddressInvalidError] if the web service believes
224+
# the IP address to be invalid or missing.
217225
#
218-
# @raise [AddressNotFoundError] if the IP address was not found.
226+
# @raise [MaxMind::GeoIP2::AddressNotFoundError] if the IP address was not
227+
# found.
219228
#
220-
# @raise [AddressReservedError] if the IP address is reserved.
229+
# @raise [MaxMind::GeoIP2::AddressReservedError] if the IP address is
230+
# reserved.
221231
#
222-
# @raise [AuthenticationError] if there was a problem authenticating to the
223-
# web service, such as an invalid or missing license key.
232+
# @raise [MaxMind::GeoIP2::AuthenticationError] if there was a problem
233+
# authenticating to the web service, such as an invalid or missing
234+
# license key.
224235
#
225-
# @raise [InsufficientFundsError] if your account is out of credit.
236+
# @raise [MaxMind::GeoIP2::InsufficientFundsError] if your account is out
237+
# of credit.
226238
#
227-
# @raise [PermissionRequiredError] if your account does not have permission
228-
# to use the web service.
239+
# @raise [MaxMind::GeoIP2::PermissionRequiredError] if your account does
240+
# not have permission to use the web service.
229241
#
230-
# @raise [InvalidRequestError] if the web service responded with an error
231-
# and there is no more specific error to raise.
242+
# @raise [MaxMind::GeoIP2::InvalidRequestError] if the web service
243+
# responded with an error and there is no more specific error to raise.
232244
#
233245
# @return [MaxMind::GeoIP2::Model::Insights]
234246
def insights(ip_address = 'me')

lib/maxmind/geoip2/reader.rb

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ def initialize(*args)
9797
# @raise [ArgumentError] if used against a non-Anonymous IP database or if
9898
# you attempt to look up an IPv6 address in an IPv4 only database.
9999
#
100-
# @raise [AddressNotFoundError] if the IP address is not found in the
101-
# database.
100+
# @raise [MaxMind::GeoIP2::AddressNotFoundError] if the IP address is not
101+
# found in the database.
102102
#
103103
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
104104
# corrupt.
@@ -121,8 +121,8 @@ def anonymous_ip(ip_address)
121121
# @raise [ArgumentError] if used against a non-Anonymous Plus database
122122
# or if you attempt to look up an IPv6 address in an IPv4 only database.
123123
#
124-
# @raise [AddressNotFoundError] if the IP address is not found in the
125-
# database.
124+
# @raise [MaxMind::GeoIP2::AddressNotFoundError] if the IP address is not
125+
# found in the database.
126126
#
127127
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
128128
# corrupt.
@@ -145,8 +145,8 @@ def anonymous_plus(ip_address)
145145
# @raise [ArgumentError] if used against a non-ASN database or if you
146146
# attempt to look up an IPv6 address in an IPv4 only database.
147147
#
148-
# @raise [AddressNotFoundError] if the IP address is not found in the
149-
# database.
148+
# @raise [MaxMind::GeoIP2::AddressNotFoundError] if the IP address is not
149+
# found in the database.
150150
#
151151
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
152152
# corrupt.
@@ -164,8 +164,8 @@ def asn(ip_address)
164164
# @raise [ArgumentError] if used against a non-City database or if you
165165
# attempt to look up an IPv6 address in an IPv4 only database.
166166
#
167-
# @raise [AddressNotFoundError] if the IP address is not found in the
168-
# database.
167+
# @raise [MaxMind::GeoIP2::AddressNotFoundError] if the IP address is not
168+
# found in the database.
169169
#
170170
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
171171
# corrupt.
@@ -183,8 +183,8 @@ def city(ip_address)
183183
# @raise [ArgumentError] if used against a non-Connection Type database or if
184184
# you attempt to look up an IPv6 address in an IPv4 only database.
185185
#
186-
# @raise [AddressNotFoundError] if the IP address is not found in the
187-
# database.
186+
# @raise [MaxMind::GeoIP2::AddressNotFoundError] if the IP address is not
187+
# found in the database.
188188
#
189189
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
190190
# corrupt.
@@ -207,8 +207,8 @@ def connection_type(ip_address)
207207
# @raise [ArgumentError] if used against a non-Country database or if you
208208
# attempt to look up an IPv6 address in an IPv4 only database.
209209
#
210-
# @raise [AddressNotFoundError] if the IP address is not found in the
211-
# database.
210+
# @raise [MaxMind::GeoIP2::AddressNotFoundError] if the IP address is not
211+
# found in the database.
212212
#
213213
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
214214
# corrupt.
@@ -226,8 +226,8 @@ def country(ip_address)
226226
# @raise [ArgumentError] if used against a non-Domain database or if you
227227
# attempt to look up an IPv6 address in an IPv4 only database.
228228
#
229-
# @raise [AddressNotFoundError] if the IP address is not found in the
230-
# database.
229+
# @raise [MaxMind::GeoIP2::AddressNotFoundError] if the IP address is not
230+
# found in the database.
231231
#
232232
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
233233
# corrupt.
@@ -245,8 +245,8 @@ def domain(ip_address)
245245
# @raise [ArgumentError] if used against a non-Enterprise database or if
246246
# you attempt to look up an IPv6 address in an IPv4 only database.
247247
#
248-
# @raise [AddressNotFoundError] if the IP address is not found in the
249-
# database.
248+
# @raise [MaxMind::GeoIP2::AddressNotFoundError] if the IP address is not
249+
# found in the database.
250250
#
251251
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
252252
# corrupt.
@@ -264,8 +264,8 @@ def enterprise(ip_address)
264264
# @raise [ArgumentError] if used against a non-ISP database or if you
265265
# attempt to look up an IPv6 address in an IPv4 only database.
266266
#
267-
# @raise [AddressNotFoundError] if the IP address is not found in the
268-
# database.
267+
# @raise [MaxMind::GeoIP2::AddressNotFoundError] if the IP address is not
268+
# found in the database.
269269
#
270270
# @raise [MaxMind::DB::InvalidDatabaseError] if the database appears
271271
# corrupt.

0 commit comments

Comments
 (0)