Don't create attachments if remote file cannot be fetched

th-downstream
Eugen Rochko 8 years ago
parent 8d767b477f
commit d2029a8845

@ -22,8 +22,6 @@ class MediaAttachment < ApplicationRecord
def file_remote_url=(url)
self.file = URI.parse(url)
rescue OpenURI::HTTPError => e
Rails.logger.debug "Error fetching remote attachment: #{e}"
end
def image?

@ -173,7 +173,7 @@ class ProcessFeedService < BaseService
begin
media.file_remote_url = link['href']
media.save
rescue Paperclip::Errors::NotIdentifiedByImageMagickError
rescue OpenURI::HTTPError, Paperclip::Errors::NotIdentifiedByImageMagickError
next
end
end

Loading…
Cancel
Save