Skip to content

Commit

Permalink
script now exits on twitter authentication error
Browse files Browse the repository at this point in the history
  • Loading branch information
mpentler committed Jan 27, 2018
1 parent 6843bf2 commit d55067f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions teletext-twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def main():
sys.exit(1)
except twitter.error.TwitterError as e:
for error in e.message:
if error['code'] == 32:
print("[!] Authentication error accessing Twitter. Check config.py file and make sure your tokens are correct.")
print("[!] Exiting...")
sys.exit(1)
print("[!] Error accessing your Twitter timeline: {}".format(error['message']), file=sys.stderr)
print("[!] Trying again after specified delay", file=sys.stderr)
time.sleep(args.delay)
Expand Down

0 comments on commit d55067f

Please sign in to comment.