Commits

Daniel Greenfeld committed d9cab68

Better error handling. Still not ideal because this stores nothing about the geocode errors it generates.

  • Participants
  • Parent commits df0b489

Comments (0)

Files changed (1)

easy_maps/models.py

 from django.utils.encoding import smart_str
 from geopy import geocoders
 
-
-
 class Address(models.Model):
     address = models.CharField(max_length=255, db_index=True)
     computed_address = models.CharField(max_length=255, null=True, blank=True)
             address = smart_str(self.address)
             self.computed_address, (self.latitude, self.longitude,) = g.geocode(address)
             self.geocode_error = False
-        except (UnboundLocalError, ValueError,):
+        except (UnboundLocalError, ValueError,geocoders.google.GQueryError):
             self.geocode_error = True
 
     def save(self, *args, **kwargs):