lib/geocoder/lookups/base.rb in geocoder-1.2.11 vs lib/geocoder/lookups/base.rb in geocoder-1.2.12
- old
+ new
@@ -188,11 +188,11 @@
if defined?(ActiveSupport::JSON)
ActiveSupport::JSON.decode(data)
else
JSON.parse(data)
end
- rescue => err
+ rescue
raise_error(ResponseParseError.new(data)) or Geocoder.log(:warn, "Geocoding API's response was not valid JSON: #{data}")
end
##
# Parses a raw search result (returns hash or array).
@@ -281,10 +281,10 @@
configuration.basic_auth[:password]
)
end
client.request(req)
end
- rescue Net::OpenTimeout, Net::ReadTimeout
+ rescue Timeout::Error
raise Geocoder::LookupTimeout
end
def use_ssl?
if supported_protocols == [:https]