Improved error handling.

This commit is contained in:
Martin Edenhofer 2016-01-10 14:36:51 +01:00
parent 40afe824f3
commit 5492c3889e

View file

@ -199,10 +199,16 @@ class TweetBase
if existing_article if existing_article
ticket = existing_article.ticket ticket = existing_article.ticket
else else
parent_tweet = @client.status(tweet.in_reply_to_status_id) begin
ticket = to_group(parent_tweet, group_id, channel) parent_tweet = @client.status(tweet.in_reply_to_status_id)
ticket = to_group(parent_tweet, group_id, channel)
rescue Twitter::Error::NotFound
# just ignore if tweet has already gone
Rails.logger.info "Can't import tweet (#{tweet.in_reply_to_status_id}), tweet not found"
end
end end
else end
if !ticket
ticket = to_ticket(tweet, user, group_id, channel) ticket = to_ticket(tweet, user, group_id, channel)
end end
to_article(tweet, user, ticket) to_article(tweet, user, ticket)