﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35681	GeoIP2Exception does not work as advertised	Jon Ribbens	Jon Ribbens	"The `contrib.gis.geoip2` module describes `GeoIP2Exception` as being ""raised when an error occurs in a call to the underlying geoip2 library"". This is completely false - the code makes no attempt whatsoever to do that. It is actually an exception raised when one of the extra checks that the django code performs fails (e.g. if the `GEOIP_PATH` setting is missing).

If the underlying `geoip2` module raises an exception then this is passed directly through to the caller unchanged. If the caller wants to catch exceptions from the `geoip2` module then they either have to catch `Exception`, or violate the encapsulation by importing `geoip2.errors` themselves.

I could provide a patch to fix this, but I would need to know what peoples' attitude would be to backwards-compatibility. Would it be better to make the code match the documentation by catching exceptions and re-throwing them as `GeoIP2Exception`, or would it be better to add a new `contrib.gis.geoip2.GeoIP2UnderlyingException` which is just an alias for `geoip2.errors.GeoIP2Error`? The latter is ugly but the former could break backwards compatibility."	Bug	closed	GIS	5.1	Normal	fixed	geoip geoip2	Jon Ribbens Flavio Curella	Ready for checkin	1	0	0	0	1	0
