GeoIPException is not imported, so use generic Exception class #103

Closed
wants to merge 1 commit into
from

2 participants

@Bouke

When using GeoIP without defining the GeoIP library path, an exception is thrown. However, an incorrect exception class is used an the real exception is hidden.

Expected result:

Exception at /test/geoip/
Could not find the GeoIP library (tried "GeoIP"). Try setting GEOIP_LIBRARY_PATH in your settings.
Request Method: GET
Request URL:    http://localhost:8000/test/geoip/
Django Version: 1.4
Exception Type: Exception
Exception Value:    
Could not find the GeoIP library (tried "GeoIP"). Try setting GEOIP_LIBRARY_PATH in your settings.

Actual result:

NameError at /test/geoip/
name 'GeoIPException' is not defined
Request Method: GET
Request URL:    http://localhost:8000/test/geoip/
Django Version: 1.4
Exception Type: NameError
Exception Value:    
name 'GeoIPException' is not defined
Exception Location: /django/contrib/gis/geoip/libgeoip.py in <module>, line 22
@apollo13
Django member

Fixed in cf7afeb, thx for the report.

@apollo13 apollo13 closed this Jan 1, 2013
@Bouke Bouke deleted the Bouke:patch-1 branch Jan 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment