New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenCage status codes #477
Comments
It is a fair note that 402 should be handled differently, and I agree with that. However, the two cases "no money on account" and "too many requests for a period of time" are currently not separated in geopy, and both are expected to be raised as I see how that difference might be useful, so I guess we could introduce a new Would that be acceptable for you? |
Hi, That would be perfect :) Thanks! :) |
Fixed in #479, will be released as geopy 2.2. 402 should now be raised as a |
Fantastic! Thanks a lot :) |
Hi,
According to the OpenCage documentation https://opencagedata.com/api#codes, code 429 corresponds to "Too many requests (too quickly, rate limiting)" while code 402 corresponds to "Valid request but quota exceeded (payment required)".
Geopy raises the following error when receiving code 429:
geopy/geopy/geocoders/opencage.py
Line 214 in 313fe5c
However, code 402 is not handled, the one linked to "The given key has gone over the requests limit in the 24 hour period", which should actually correspond to exception
GeocoderQuotaExceeded
, while code 429 should be associated with another type of exception, since it should be possible to retry after some backoff time.Is this something that could be handled? :)
Thank you!
The text was updated successfully, but these errors were encountered: