lib/geocoder/lookups/base.rb in geocoder-1.2.6 vs lib/geocoder/lookups/base.rb in geocoder-1.2.7
- old
+ new
@@ -180,18 +180,18 @@
if defined?(ActiveSupport::JSON)
ActiveSupport::JSON.decode(data)
else
JSON.parse(data)
end
+ rescue => err
+ raise_error(ResponseParseError.new(data)) or warn "Geocoding API's response was not valid JSON."
end
##
# Parses a raw search result (returns hash or array).
#
def parse_raw_data(raw_data)
parse_json(raw_data)
- rescue
- warn "Geocoding API's response was not valid JSON."
end
##
# Protocol to use for communication with geocoding services.
# Set in configuration but not available for every service.