lib/geocoder/lookups/yandex.rb in geocoder-1.2.7 vs lib/geocoder/lookups/yandex.rb in geocoder-1.2.8

- old
+ new

@@ -20,20 +20,20 @@ def results(query) return [] unless doc = fetch_data(query) if err = doc['error'] if err["status"] == 401 and err["message"] == "invalid key" - raise_error(Geocoder::InvalidApiKey) || warn("Invalid API key.") + raise_error(Geocoder::InvalidApiKey) || Geocoder.log(:warn, "Invalid API key.") else - warn "Yandex Geocoding API error: #{err['status']} (#{err['message']})." + Geocoder.log(:warn, "Yandex Geocoding API error: #{err['status']} (#{err['message']}).") end return [] end if doc = doc['response']['GeoObjectCollection'] meta = doc['metaDataProperty']['GeocoderResponseMetaData'] return meta['found'].to_i > 0 ? doc['featureMember'] : [] else - warn "Yandex Geocoding API error: unexpected response format." + Geocoder.log(:warn, "Yandex Geocoding API error: unexpected response format.") return [] end end def query_url_params(query)