Skip to content

Instantly share code, notes, and snippets.

@peterlie
Last active December 17, 2015 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterlie/65fe0f3f349c1cb83a99 to your computer and use it in GitHub Desktop.
Save peterlie/65fe0f3f349c1cb83a99 to your computer and use it in GitHub Desktop.
need to parse errors returned by Tweepy?
import ast
reason = ast.literal_eval(e.reason)
message = reason[0]['message']
code = reason[0]['code']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment