Skip to content

Commit

Permalink
Catching more exceptions, image_finder just failed on a mailto: uri.
Browse files Browse the repository at this point in the history
  • Loading branch information
futurechimp committed Jun 11, 2011
1 parent 0536b8a commit dfb0ed8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/image_finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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" ||
Expand Down

0 comments on commit dfb0ed8

Please sign in to comment.