From: Paul Woolcock Date: Mon, 26 Feb 2018 21:01:49 +0000 (-0500) Subject: Some images can cause `convert` to fail, which crashes this whole task (#6565) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=76198c63b613f353f2e4a82ce89a8450ca219b88;p=mastodon.git Some images can cause `convert` to fail, which crashes this whole task (#6565) * Some images can cause `convert` to fail, which crashes this whole task * Add more specific exception --- diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake index bf4c53cb3..a06e35226 100644 --- a/lib/tasks/mastodon.rake +++ b/lib/tasks/mastodon.rake @@ -494,9 +494,13 @@ namespace :mastodon do accounts = accounts.where(domain: ENV['DOMAIN']) if ENV['DOMAIN'].present? accounts.find_each do |account| - account.reset_avatar! - account.reset_header! - account.save + begin + account.reset_avatar! + account.reset_header! + account.save + rescue Paperclip::Error + puts "Error resetting avatar and header for account #{username}@#{domain}" + end end end end