Specify the error that we want to ignore instead of rescuing all errors.
This commit is contained in:
parent
d7d22554ca
commit
089a1bd3be
|
@ -10,7 +10,12 @@ class FinalDestination
|
|||
attr_reader :cookie
|
||||
|
||||
def initialize(url, opts=nil)
|
||||
@uri = URI(url) rescue nil
|
||||
@uri =
|
||||
begin
|
||||
URI(url) if url
|
||||
rescue URI::InvalidURIError
|
||||
end
|
||||
|
||||
@opts = opts || {}
|
||||
@opts[:max_redirects] ||= 5
|
||||
@opts[:lookup_ip] ||= lambda do |host|
|
||||
|
|
Loading…
Reference in New Issue