From 26a0c963e6fc3daecbb9cf47263ced1dc2babaef Mon Sep 17 00:00:00 2001 From: Alex Reisner Date: Mon, 6 Jan 2020 19:02:38 -0800 Subject: [PATCH] Remove irrelevant code. Appears to be copied from another lookup. Will not work with :ipgeolocation. --- lib/geocoder/lookups/ipgeolocation.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/geocoder/lookups/ipgeolocation.rb b/lib/geocoder/lookups/ipgeolocation.rb index 56d763cce..adfc655d3 100644 --- a/lib/geocoder/lookups/ipgeolocation.rb +++ b/lib/geocoder/lookups/ipgeolocation.rb @@ -37,14 +37,7 @@ def query_url_params(query) def results(query) # don't look up a loopback or private address, just return the stored result return [reserved_result(query.text)] if query.internal_ip_address? - return [] unless doc = fetch_data(query) - if error = doc['error'] - code = error['code'] - msg = error['info'] - raise_error(ERROR_CODES[code], msg ) || Geocoder.log(:warn, "Ipgeolocation Geocoding API error: #{msg}") - return [] - end - [doc] + [fetch_data(query)] end def reserved_result(ip)