Skipping instead of stopping

This commit is contained in:
jeancf 2023-07-18 16:24:24 +02:00
parent 9231a78881
commit 5d36cd2f7e

View File

@ -1222,8 +1222,8 @@ def main(argv):
_, _, _, exception_message = e.args _, _, _, exception_message = e.args
if 'Text character limit' in exception_message: if 'Text character limit' in exception_message:
# 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('Tweet text too long: %s characters', str(len(tweet['tweet_text']))) logging.error('Toot text too long: %s characters. Skipping.', str(len(tweet['tweet_text'])))
shutdown(-1) continue
elif 'Try again in a moment' in exception_message: elif 'Try again in a moment' in exception_message:
# 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.')