Commits

Mikhail Korobov committed 5af56a2

Catch proper exception. Should fix BB-17

Comments (0)

Files changed (1)

easy_maps/geocode.py

 from __future__ import absolute_import
 from django.utils.encoding import smart_str
 from geopy import geocoders
+from geopy.geocoders.base import GeocoderResultError
 
 class Error(Exception):
     pass
         g = geocoders.GoogleV3()
         address = smart_str(address)
         return g.geocode(address, exactly_one=False)[0]
-    except (UnboundLocalError, ValueError, geocoders.google.GQueryError) as e:
+    except (UnboundLocalError, ValueError, GeocoderResultError) as e:
         raise Error(e)