From 9dafa675d126762335098734e14f37b8a0187829 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Mon, 27 Dec 2021 23:03:51 +0100 Subject: [PATCH] Log on `ShareWorker` Twitter exceptions --- app/workers/share_worker.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/workers/share_worker.rb b/app/workers/share_worker.rb index 9b552cd0..af83aa86 100644 --- a/app/workers/share_worker.rb +++ b/app/workers/share_worker.rb @@ -16,10 +16,12 @@ class ShareWorker # The question to be posted was deleted return rescue Twitter::Error::DuplicateStatus + logger.info "Tried to post answer ##{answer_id} from user ##{user_id} to Twitter but the status was already posted." return rescue Twitter::Error::Unauthorized # User's Twitter token has expired or been revoked # TODO: Notify user if this happens (https://github.com/Retrospring/retrospring/issues/123) + logger.info "Tried to post answer ##{answer_id} from user ##{user_id} to Twitter but the token has exired or been revoked." return rescue => e logger.info "failed to post answer #{answer_id} to #{service} for user #{user_id}: #{e.message}"