From f19232646f73d585cbcc25b9955ddfa8756c8aaa Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 23 Aug 2016 15:05:37 +0800 Subject: [PATCH] Rescue all errors when backfilling shas for uploads. --- lib/tasks/uploads.rake | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rake index 22f81074b31..2d564b42e40 100644 --- a/lib/tasks/uploads.rake +++ b/lib/tasks/uploads.rake @@ -71,11 +71,8 @@ task "uploads:backfill_shas" => :environment do u.sha1 = Digest::SHA1.file(path).hexdigest u.save! putc "." - rescue ActiveRecord::RecordInvalid - puts "#{u.extension} is not valid" - putc "X" - rescue Errno::ENOENT - putc "X" + rescue => e + putc "Skipping #{upload.original_filename} (#{upload.url}) #{e.message}" end end end