Skip to content

Commit

Permalink
Better logging for weird issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorcorrea committed May 3, 2024
1 parent c3c854a commit e1d02d7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/controllers/works_wizard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,12 @@ def file_uploaded
else
redirect_to(work_review_path)
end
rescue StandardError => active_storage_error
Rails.logger.error("Failed to attach the file uploads for the work #{@work.doi}: #{active_storage_error}")
flash[:notice] = "Failed to attach the file uploads for the work #{@work.doi}: #{active_storage_error}. Please contact rdss@princeton.edu for assistance."
rescue => ex
# Notice that we log the URL (rather than @work.doi) because sometimes we are getting a nil @work.
# The URL will include the ID and might help us troubleshoot the issue further if it happens again.
# See https://github.com/pulibrary/pdc_describe/issues/1801
Rails.logger.error("Failed to update work snapshot, URL: #{request.url}: #{ex}")
flash[:notice] = "Failed to update work snapshot, work: #{@work&.doi}: #{ex}. Please contact rdss@princeton.edu for assistance."

redirect_to work_file_upload_path(@work)
end
Expand Down

0 comments on commit e1d02d7

Please sign in to comment.