Print error messages on why upload fails to save.

This commit is contained in:
Guo Xiang Tan 2018-09-10 16:02:13 +08:00
parent 8c374f339c
commit 68572b8afc

View File

@ -787,7 +787,11 @@ def recover_from_s3_by_sha1(post:, sha1:, object_keys: [])
File.basename(key)
).create_for(post.user_id)
post.rebake! if upload.persisted?
if upload.persisted?
post.rebake!
else
puts "#{post.full_url}\n#{upload.errors.full_messages.join("\n")}"
end
end
ensure
tmp&.close