maxmind / GeoIP2-python

Python code for GeoIP2 webservice client and database reader
https://geoip2.readthedocs.org/en/latest/
Apache License 2.0
1.11k stars 141 forks source link

ReadTimeout from https://geoip.maxmind.com/geoip/v2.1/city/{ip} #87

Closed simoncrowe closed 4 years ago

simoncrowe commented 4 years ago

I've noticed a couple of instances of unhanded ReadTimout exceptions from geoip2.webservice.Client._response_for (line 157 in version 3.0.0).

Here's the sentry issue: https://sentry.io/share/issue/dea40ba4e7044dc5b70273b5f15b62e9/

I don't know this library and its public API well enough to know whether there's a nicer way to deal with these exceptions.

If you think it's the library user's responsibility to deal with these exceptions (as has happened in the codebase I'm working on) , feel free to close this.

oschwald commented 4 years ago

The intent is to throw exceptions on errors, although we should probably be wrapping them rather than throwing the underlying Requests exception.

simoncrowe commented 4 years ago

From my employer's perspective, wrapping the exception will mean a hotfix in our codebase, so I'm inclined just to close this issue.