I have the following code:

begin
  site = RedirectFollower.new(url).resolve
rescue => e
  puts e.to_s
  return false
end

Which throws errors like:

the scheme http does not accept registry part: www.officedepot.com;

the scheme http does not accept registry part: ww2.google.com/something;

Operation timed out - connect(2)

How can I add in another rescue for all errors that are like the scheme http does not accept registry part?

Since I want to do something other than just printing the error and returning false in that case.

Edit
Report