capture errors thrown on upload preprocessing create

This commit is contained in:
Albert Yi
2018-06-19 11:28:13 -07:00
parent 558be081b2
commit 35bc9a2e32

View File

@@ -322,11 +322,10 @@ class UploadService
params[:tag_string] ||= "tagme"
CurrentUser.as(User.find(uploader_id)) do
upload = Upload.create!(params)
upload.update(status: "preprocessing")
begin
upload = Upload.create!(params)
upload.update(status: "preprocessing")
if source.present?
file = Utils.download_for_upload(source, upload)
elsif params[:file].present?