Added exception for unkonwn twitter article type.

This commit is contained in:
Thorsten Eckel 2015-07-03 10:22:36 +02:00
parent 44593cd800
commit 0703c53732

View file

@ -195,7 +195,6 @@ class Tweet
def from_article(article) def from_article(article)
tweet = nil tweet = nil
if article[:type] == 'twitter direct-message' if article[:type] == 'twitter direct-message'
@ -206,7 +205,6 @@ class Tweet
article[:body], article[:body],
{} {}
) )
elsif article[:type] == 'twitter status' elsif article[:type] == 'twitter status'
Rails.logger.debug "Create tweet from article..." Rails.logger.debug "Create tweet from article..."
@ -217,6 +215,8 @@ class Tweet
in_reply_to_status_id: article[:in_reply_to] in_reply_to_status_id: article[:in_reply_to]
} }
) )
else
fail "Can't handle unknown twitter article type 'article[:type]'."
end end
Rails.logger.debug tweet.inspect Rails.logger.debug tweet.inspect