libforget mastodon: same thing. raise temporaryerror if no access
This commit is contained in:
parent
60e2357597
commit
649b68793c
|
@ -100,13 +100,11 @@ def get_api_for_acc(account):
|
||||||
except (MastodonNetworkError,
|
except (MastodonNetworkError,
|
||||||
MastodonRatelimitError) as e:
|
MastodonRatelimitError) as e:
|
||||||
raise TemporaryError(e)
|
raise TemporaryError(e)
|
||||||
|
raise TemporaryError('No access to account {}'.format(account))
|
||||||
|
|
||||||
|
|
||||||
def fetch_acc(acc, cursor=None):
|
def fetch_acc(acc, cursor=None):
|
||||||
api = get_api_for_acc(acc)
|
api = get_api_for_acc(acc)
|
||||||
if not api:
|
|
||||||
print('no access, aborting')
|
|
||||||
return None
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
newacc = account_from_api_object(
|
newacc = account_from_api_object(
|
||||||
|
@ -176,8 +174,6 @@ def account_from_api_object(obj, instance):
|
||||||
def refresh_posts(posts):
|
def refresh_posts(posts):
|
||||||
acc = posts[0].author
|
acc = posts[0].author
|
||||||
api = get_api_for_acc(acc)
|
api = get_api_for_acc(acc)
|
||||||
if not api:
|
|
||||||
raise Exception('no access')
|
|
||||||
|
|
||||||
new_posts = list()
|
new_posts = list()
|
||||||
for post in posts:
|
for post in posts:
|
||||||
|
|
Loading…
Reference in New Issue