Skip to content
Snippets Groups Projects
Commit 732895a8 authored by Alex Reisner's avatar Alex Reisner
Browse files

Add OverQueryLimitError and raise for Google.

parent a0f7afac
No related branches found
No related tags found
No related merge requests found
...@@ -5,4 +5,7 @@ module Geocoder ...@@ -5,4 +5,7 @@ module Geocoder
class ConfigurationError < Error class ConfigurationError < Error
end end
class OverQueryLimitError < Error
end
end end
...@@ -15,7 +15,8 @@ module Geocoder::Lookup ...@@ -15,7 +15,8 @@ module Geocoder::Lookup
case doc['status']; when "OK" # OK status implies >0 results case doc['status']; when "OK" # OK status implies >0 results
return doc['results'] return doc['results']
when "OVER_QUERY_LIMIT" when "OVER_QUERY_LIMIT"
warn "Google Geocoding API error: over query limit." raise_error(Geocoder::OverQueryLimitError) ||
warn("Google Geocoding API error: over query limit.")
when "REQUEST_DENIED" when "REQUEST_DENIED"
warn "Google Geocoding API error: request denied." warn "Google Geocoding API error: request denied."
when "INVALID_REQUEST" when "INVALID_REQUEST"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment