Apply review suggestions from @nilsding
Co-authored-by: Georg Gadinger <nilsding@nilsding.org>
This commit is contained in:
parent
44e144cecc
commit
481f3c4d8f
|
@ -16,19 +16,15 @@ class ShareWorker
|
|||
rescue ActiveRecord::RecordNotFound
|
||||
logger.info "Tried to post answer ##{answer_id} for user ##{user_id} to #{service.titleize} but the user/answer/service did not exist (likely deleted), will not retry."
|
||||
# The question to be posted was deleted
|
||||
nil
|
||||
rescue Twitter::Error::DuplicateStatus
|
||||
logger.info "Tried to post answer ##{answer_id} from user ##{user_id} to Twitter but the status was already posted."
|
||||
nil
|
||||
rescue Twitter::Error::Forbidden
|
||||
# User's Twitter account is suspended
|
||||
logger.info "Tried to post answer ##{answer_id} from user ##{user_id} to Twitter but the account is suspended."
|
||||
nil
|
||||
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."
|
||||
nil
|
||||
rescue => e
|
||||
logger.info "failed to post answer #{answer_id} to #{service} for user #{user_id}: #{e.message}"
|
||||
Sentry.capture_exception(e)
|
||||
|
|
Loading…
Reference in New Issue