python - tweepy/ twitter api error type -
i using tweepy make twitter application. when users tweet/update profile, etc, errors. want classify error , give user more information.
try: tweet/update profile/ follow.... except tweepy.tweeperror, e: if tweepy.tweeperror "account update failed: description long (maximum 160 characters)" if tweepy.tweeperror "failed send request: invalid request url: http://api.twitter.com/1/account/update_profile.json?location=%e5%85%b5%e5%ba%a" if tweepy.tweeperror "[{u'message': u'over capacity', u'code': 130}]"
is way classify error compare e
string, example, account update failed: description long (maximum 160 characters)
?
right, way now. there 1 tweeperror exception defined. it's raised throughout app different text.
here's relevant open issue on github. there chance it'll improved in future.
Comments
Post a Comment