lib/geocoder/lookups/nominatim.rb in geocoder-1.1.9 vs lib/geocoder/lookups/nominatim.rb in geocoder-1.2.0
- old
+ new
@@ -23,9 +23,17 @@
def results(query)
return [] unless doc = fetch_data(query)
doc.is_a?(Array) ? doc : [doc]
end
+ def parse_raw_data(raw_data)
+ if raw_data.include?("Bandwidth limit exceeded")
+ raise_error(Geocoder::OverQueryLimitError) || warn("Over API query limit.")
+ else
+ super(raw_data)
+ end
+ end
+
def query_url_params(query)
params = {
:format => "json",
:addressdetails => "1",
:"accept-language" => configuration.language