为什么我的rescue
没有从例外中解救?
错误
2016-07-14T09:43:06.062Z 6490 TID-ox0hrishg WARN: URI::InvalidURIError: bad URI(is not URI?):
2016-07-14T09:43:06.062Z 6490 TID-ox0hrishg WARN: /Users/stas/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/uri/rfc3986_parser.rb:18:in `rescue in split'
begin
xml_loop(@xml.products)
rescue URI::InvalidURIError
index = @xml.get_index(XmlTracker.last.xml_id)
xml_loop(@xml.products[index...900])
else
....
end
如何处理?
答案 0 :(得分:1)
您忘记将end
块放入begin
块
begin
xml_loop(@xml.products)
rescue URI::InvalidURIError
index = @xml.get_index(XmlTracker.last.xml_id)
xml_loop(@xml.products[index...900])
end