【发布时间】:2011-11-29 21:34:34
【问题描述】:
我有以下代码:
begin
site = RedirectFollower.new(url).resolve
rescue => e
puts e.to_s
return false
end
这会引发如下错误:
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)
如何为所有类似the scheme http does not accept registry part 的错误添加另一个救援?
因为我想做的不仅仅是打印错误并在这种情况下返回 false。
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-3 ruby-on-rails-3.1