lib/geocoder/lookups/baidu_ip.rb in geocoder-1.2.7 vs lib/geocoder/lookups/baidu_ip.rb in geocoder-1.2.8
- old
+ new
@@ -23,22 +23,22 @@
case doc['status']
when 0
return [doc['content']] unless doc['content'].blank?
when 1, 3, 4
raise_error(Geocoder::Error, "server error.") ||
- warn("Baidu IP Geocoding API error: server error.")
+ Geocoder.log(:warn, "Baidu IP Geocoding API error: server error.")
when 2
raise_error(Geocoder::InvalidRequest, "invalid request.") ||
- warn("Baidu IP Geocoding API error: invalid request.")
+ Geocoder.log(:warn, "Baidu IP Geocoding API error: invalid request.")
when 5
raise_error(Geocoder::InvalidApiKey, "invalid api key.") ||
- warn("Baidu IP Geocoding API error: invalid api key.")
+ Geocoder.log(:warn, "Baidu IP Geocoding API error: invalid api key.")
when 101, 102, 200..299
raise_error(Geocoder::RequestDenied, "request denied.") ||
- warn("Baidu IP Geocoding API error: request denied.")
+ Geocoder.log(:warn, "Baidu IP Geocoding API error: request denied.")
when 300..399
raise_error(Geocoder::OverQueryLimitError, "over query limit") ||
- warn("Baidu IP Geocoding API error: over query limit.")
+ Geocoder.log(:warn, "Baidu IP Geocoding API error: over query limit.")
end
return []
end
def query_url_params(query)