From dfb0ed89fb12ee85fd4d552cb1cf30c66508febb Mon Sep 17 00:00:00 2001 From: futurechimp Date: Sat, 11 Jun 2011 16:22:08 +0100 Subject: [PATCH] Catching more exceptions, image_finder just failed on a mailto: uri. --- lib/image_finder.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/image_finder.rb b/lib/image_finder.rb index 35b7603..10baeac 100644 --- a/lib/image_finder.rb +++ b/lib/image_finder.rb @@ -39,10 +39,11 @@ def parse(data) _image_urls = uris.select{|u| begin uri = URI.parse(u) - rescue URI::InvalidURIError + rescue Exception => ex # Feel no pain! This guards against crappy uri parsing errors, # e.g. on "URIs" like "TRON:" (which I'm getting an error on right - # now). + # now). + puts "Imagefinder exception: #{ex}" end if uri && uri.path File.extname(uri.path) == ".jpg" ||