From 60e2357597b41fa0d649eddc592a9f20d34027c6 Mon Sep 17 00:00:00 2001 From: codl Date: Sun, 24 Feb 2019 12:48:58 +0100 Subject: [PATCH] twitter: raise temporaryerror when no access instead of silently failing --- libforget/twitter.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libforget/twitter.py b/libforget/twitter.py index 9645632..c9ba7ae 100644 --- a/libforget/twitter.py +++ b/libforget/twitter.py @@ -92,7 +92,7 @@ def get_twitter_for_acc(account): except URLError as e: raise TemporaryError(e) - return None + raise TemporaryError("No access to account {}".format(account)) locale.setlocale(locale.LC_TIME, 'C') @@ -125,9 +125,6 @@ def post_from_api_tweet_object(tweet, post=None): def fetch_acc(account, cursor): t = get_twitter_for_acc(account) - if not t: - print("no twitter access, aborting") - return try: user = t.account.verify_credentials() @@ -176,8 +173,6 @@ def refresh_posts(posts): return posts t = get_twitter_for_acc(posts[0].author) - if not t: - return try: tweets = t.statuses.lookup( _id=",".join((post.twitter_id for post in posts)),