Log on `ShareWorker` Twitter exceptions

This commit is contained in:
Karina Kwiatek 2021-12-27 23:03:51 +01:00
parent d73e269d85
commit 9dafa675d1
1 changed files with 2 additions and 0 deletions

View File

@ -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}"