3 from twitter
.util
import printNicely
7 def detail_twitter_error(twitterException
):
9 Display Twitter Errors nicely
12 # twitterException.response_data can be byte string on Python 3
13 # or nornal dict on Python 2
14 loadedJson
= json
.loads(twitterException
.response_data
.decode('utf8'))
15 for m
in loadedJson
.get('errors', dict()):
16 info
= "Error " + str(m
.get('code')) + ": " + m
.get('message')
17 printNicely(yellow(info
))
19 info
= "Error: " + twitterException
.response_data
.decode('utf8')
20 printNicely(yellow(info
))