From 0703c53732854dccd76652453ee080db88d60d3c Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Fri, 3 Jul 2015 10:22:36 +0200 Subject: [PATCH] Added exception for unkonwn twitter article type. --- lib/tweet.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tweet.rb b/lib/tweet.rb index 171b1b0bb..b18d6fb86 100644 --- a/lib/tweet.rb +++ b/lib/tweet.rb @@ -195,7 +195,6 @@ class Tweet def from_article(article) - tweet = nil if article[:type] == 'twitter direct-message' @@ -206,7 +205,6 @@ class Tweet article[:body], {} ) - elsif article[:type] == 'twitter status' Rails.logger.debug "Create tweet from article..." @@ -217,6 +215,8 @@ class Tweet in_reply_to_status_id: article[:in_reply_to] } ) + else + fail "Can't handle unknown twitter article type 'article[:type]'." end Rails.logger.debug tweet.inspect