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

Merge branch 'master' of git://github.com/verticalbrands/geocoder into verticalbrands-master

Conflicts:
	lib/geocoder/lookups/base.rb
parents 3cc4a205 9301973d
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
......@@ -100,7 +100,8 @@ module Geocoder
# Return false if exception not raised.
#
def raise_error(error, message = nil)
if Geocoder::Configuration.always_raise.include?( error.is_a?(Class) ? error : error.class )
exceptions = Geocoder::Configuration.always_raise
if exceptions == :all or exceptions.include?( error.is_a?(Class) ? error : error.class )
raise error, message
else
false
......
......@@ -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