#35681: GeoIP2Exception does not work as advertised
------------------------------+--------------------------------------
Reporter: Jon Ribbens | Owner: (none)
Type: Bug | Status: new
Component: GIS | Version: 5.1
Severity: Normal | Resolution:
Keywords: geoip geoip2 | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
------------------------------+--------------------------------------
Comment (by rampypi):
Hi everyone,
I’m new to contributing to Django and noticed this issue reported by Jon
Ribbens regarding the GeoIP2Exception in the django.contrib.gis.geoip2
module. I understand that the current implementation does not align with
the documentation, as GeoIP2Exception is not handling exceptions from the
geoip2 library as described.
I’m interested in collaborating on this issue and would like to contribute
a solution. My goal is to address the discrepancy between the
documentation and the implementation. Here are a few thoughts on how we
might approach it:
{{{
Update the Code: Modify the GeoIP2 class to catch exceptions from the
geoip2 library and re-raise them as GeoIP2Exception, aligning with the
documentation. This might impact backward compatibility.
Introduce a New Exception: Create a new exception class,
GeoIP2UnderlyingException, which wraps geoip2.errors.GeoIP2Error. This
would preserve backward compatibility while providing a clear way to
handle underlying exceptions.
}}}
I’m open to suggestions and feedback on these approaches or any other
ideas you might have. If possible, I would like to take ownership of this
ticket and work on a solution.
Please let me know if there are any additional considerations or if you
would prefer a specific approach.
--
Ticket URL: <
https://code.djangoproject.com/ticket/35681#comment:1>