Merge pull request #186 from tms/oneboxes-shouldnt-explode

Oneboxes shouldn't explode when the remote causes an HTTPError
This commit is contained in:
Sam 2013-02-17 13:52:40 -08:00
commit bc1f8244e4
1 changed files with 4 additions and 2 deletions

View File

@ -42,7 +42,7 @@ module Oneboxer
end
(doc/"link[@type='text/json+oembed']").each do |oembed|
return OembedOnebox.new(oembed[:href]).onebox
end
end
# Check for opengraph
open_graph = Oneboxer.parse_open_graph(doc)
@ -50,7 +50,9 @@ module Oneboxer
end
end
nil
nil
rescue OpenURI::HTTPError
nil
end
# Parse URLs out of HTML, returning the document when finished.