diff --git a/omgeo/services/esri.py b/omgeo/services/esri.py index 437bd9d..f6d516c 100644 --- a/omgeo/services/esri.py +++ b/omgeo/services/esri.py @@ -195,7 +195,7 @@ def _geocode(self, pq): c = Candidate() attributes = location['attributes'] c.match_addr = attributes['Match_addr'] - c.locator = attributes['Loc_name'] + c.locator = attributes.get('Loc_name', '') c.locator_type = attributes['Addr_type'] c.score = attributes['Score'] c.x = attributes['DisplayX'] # represents the actual location of the address. @@ -210,7 +210,8 @@ def _geocode(self, pq): setattr(c, out_key, attributes.get(in_key, '')) setattr(c, 'match_streetaddr', self._street_addr_from_response(attributes)) returned_candidates.append(c) - except KeyError: + except KeyError as e: + logger.warning('Missing key: ' + e) pass return returned_candidates