From 73b18af6ff8da108e067f7d6b1b34dd6ba9b3d69 Mon Sep 17 00:00:00 2001 From: Georg Gadinger Date: Fri, 31 Mar 2017 23:17:36 +0200 Subject: [PATCH] Notify errors to Rollbar --- app/workers/deletion_worker.rb | 1 + app/workers/question_worker.rb | 1 + app/workers/share_worker.rb | 1 + lib/exporter.rb | 3 ++- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/workers/deletion_worker.rb b/app/workers/deletion_worker.rb index bd98371f..af8042f3 100644 --- a/app/workers/deletion_worker.rb +++ b/app/workers/deletion_worker.rb @@ -9,6 +9,7 @@ class DeletionWorker User.find(resource_id).destroy! rescue => e logger.info "failed to delete user: #{e.message}" + Rollbar.error(e) end end end diff --git a/app/workers/question_worker.rb b/app/workers/question_worker.rb index 98a614c8..adfd5610 100644 --- a/app/workers/question_worker.rb +++ b/app/workers/question_worker.rb @@ -22,6 +22,7 @@ class QuestionWorker end rescue => e logger.info "failed to ask question: #{e.message}" + Rollbar.error(e) end end end diff --git a/app/workers/share_worker.rb b/app/workers/share_worker.rb index 0bc57799..ab6d869f 100644 --- a/app/workers/share_worker.rb +++ b/app/workers/share_worker.rb @@ -12,6 +12,7 @@ class ShareWorker service.post(Answer.find(answer_id)) if services.include? service.provider rescue => e logger.info "failed to post answer #{answer_id} to #{service.provider} for user #{user_id}: #{e.message}" + Rollbar.error(e) end end end diff --git a/lib/exporter.rb b/lib/exporter.rb index cd8a07b7..035bf064 100644 --- a/lib/exporter.rb +++ b/lib/exporter.rb @@ -21,7 +21,8 @@ class Exporter collect_smiles finalize publish - rescue => _ + rescue => e + Rollbar.error(e) @user.export_processing = false @user.save validate: false end