Skip to content
Snippets Groups Projects
Commit 9301973d authored by Andy Kim's avatar Andy Kim
Browse files

Raise exceptions for google REQUEST_DENIED and INVALID_REQUEST

parent 45072eb8
No related branches found
No related tags found
No related merge requests found
......@@ -8,4 +8,11 @@ module Geocoder
class OverQueryLimitError < Error
end
class RequestDenied < Error
end
class InvalidRequest < Error
end
end
......@@ -18,9 +18,11 @@ module Geocoder::Lookup
raise_error(Geocoder::OverQueryLimitError) ||
warn("Google Geocoding API error: over query limit.")
when "REQUEST_DENIED"
warn "Google Geocoding API error: request denied."
raise_error(Geocoder::RequestDenied) ||
warn("Google Geocoding API error: request denied.")
when "INVALID_REQUEST"
warn "Google Geocoding API error: invalid request."
raise_error(Geocoder::InvalidRequest) ||
warn("Google Geocoding API error: invalid request.")
end
return []
end
......
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