Oneboxes shouldn't explode when the remote causes an HTTPError

This commit is contained in:
tms 2013-02-17 04:10:17 -05:00
parent 921c3f016f
commit 702fbcdfa8

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.