-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better logging for error updating snapshots (#1804)
* Better logging for weird issue * Adjust the test to match the new error messages * Also report errors to honeybadger where we're more likely to see them * Rubocop fix --------- Co-authored-by: Bess Sadler <[email protected]>
- Loading branch information
1 parent
c3c854a
commit e35dd92
Showing
3 changed files
with
12 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,9 +80,14 @@ 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 [email protected] 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 | ||
error_message = "Failed to update work snapshot, URL: #{request.url}: #{ex}" | ||
Rails.logger.error(error_message) | ||
Honeybadger.notify(error_message) | ||
flash[:notice] = "Failed to update work snapshot, work: #{@work&.doi}: #{ex}. Please contact [email protected] for assistance." | ||
|
||
redirect_to work_file_upload_path(@work) | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters