Skip to content
Snippets Groups Projects
Commit 98691705 authored by Luke Ledet's avatar Luke Ledet Committed by Alex Reisner
Browse files

Raise errors (if configured) to let the developer using the gem handle them

parent 4978eff8
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,8 @@ module Geocoder::Lookup ...@@ -11,7 +11,8 @@ module Geocoder::Lookup
return [reserved_result(query)] if loopback_address?(query) return [reserved_result(query)] if loopback_address?(query)
begin begin
return (doc = fetch_data(query, reverse)) ? [doc] : [] return (doc = fetch_data(query, reverse)) ? [doc] : []
rescue StandardError # Freegeoip.net returns HTML on bad request rescue StandardError => err # Freegeoip.net returns HTML on bad request
raise_error(err)
return [] return []
end end
end 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