Improved error handling.
This commit is contained in:
parent
40afe824f3
commit
5492c3889e
1 changed files with 9 additions and 3 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue