mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-02-25 17:38:43 +00:00
Compare commits
2 Commits
a4d5686308
...
8dd7e0acdf
Author | SHA1 | Date | |
---|---|---|---|
|
8dd7e0acdf | ||
|
c9b5db72f3 |
4
twoot.py
4
twoot.py
@ -1245,12 +1245,12 @@ def main(argv):
|
|||||||
|
|
||||||
except MastodonAPIError as e:
|
except MastodonAPIError as e:
|
||||||
_, _, _, exception_message = e.args
|
_, _, _, exception_message = e.args
|
||||||
if 'Text character limit' in exception_message:
|
if exception_message.find('Text character limit') != -1:
|
||||||
# ERROR (('Mastodon API returned error', 422, 'Unprocessable Entity', 'Validation failed: Text character limit of 500 exceeded'))
|
# ERROR (('Mastodon API returned error', 422, 'Unprocessable Entity', 'Validation failed: Text character limit of 500 exceeded'))
|
||||||
logging.error('Toot text too long: %s characters', str(len(tweet['tweet_text'])))
|
logging.error('Toot text too long: %s characters', str(len(tweet['tweet_text'])))
|
||||||
logging.error('posting ' + tweet['tweet_id'] + ' to ' + TOML['config']['mastodon_instance'] + ' Failed')
|
logging.error('posting ' + tweet['tweet_id'] + ' to ' + TOML['config']['mastodon_instance'] + ' Failed')
|
||||||
continue
|
continue
|
||||||
elif 'Try again in a moment' in exception_message:
|
elif exception_message.find('Try again in a moment') != -1:
|
||||||
# ERROR ('Mastodon API returned error', 422, 'Unprocessable Entity', 'Cannot attach files that have not finished processing. Try again in a moment!')
|
# ERROR ('Mastodon API returned error', 422, 'Unprocessable Entity', 'Cannot attach files that have not finished processing. Try again in a moment!')
|
||||||
logging.warning('Mastodon API Error 422: Cannot attach files that have not finished processing. Waiting 30 seconds and retrying.')
|
logging.warning('Mastodon API Error 422: Cannot attach files that have not finished processing. Waiting 30 seconds and retrying.')
|
||||||
# Wait 30 seconds
|
# Wait 30 seconds
|
||||||
|
Loading…
x
Reference in New Issue
Block a user