Skip to content

Commit

Permalink
small amendments to error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
agnessa committed Jan 6, 2017
1 parent 5723044 commit 75a1529
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/workers/changes_history_generator_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ def perform(aru_id, user_id)
aru = Trade::AnnualReportUpload.find(aru_id)
rescue ActiveRecord::RecordNotFound => e
# catch this exception so that retry is not scheduled
message = "CITES Report #{aru_id} not found"
Rails.logger.warn message
Rails.logger.warn "CITES Report #{aru_id} not found"
Appsignal.add_exception(e) if defined? Appsignal
NotificationMailer.changelog_failed(user, aru).deliver
end
Expand All @@ -25,9 +24,10 @@ def perform(aru_id, user_id)
obj.upload_file(tempfile.path)

aru.update_attributes(aws_storage_path: obj.public_url)
rescue => e
Rails.logger.info("Something went wrong while uploading file to S3")
Rails.logger.info(e)
rescue Aws::S3::Errors::ServiceError => e
Rails.logger.warn "Something went wrong while uploading #{aru.id} to S3"
Rails.logger.warn e.class
Appsignal.add_exception(e) if defined? Appsignal
end

NotificationMailer.changelog(user, aru, tempfile).deliver
Expand Down

0 comments on commit 75a1529

Please sign in to comment.