Bir twitter uygulaması yapmak için tweepy kullanıyorum. Kullanıcılar profili tweet attığında/güncellediğinde, bazı hatalar alacaklar. Hatayı sınıflandırmak ve kullanıcıya daha fazla bilgi vermek istiyorum.tweepy/twitter api hata türü
try:
tweet/update profile/ follow....
except tweepy.TweepError, e:
if tweepy.TweepError is "Account update failed: Description is too long (maximum is 160 characters)"
Do something
if tweepy.TweepError is "Failed to send request: Invalid request URL: http://api.twitter.com/1/account/update_profile.json?location=%E5%85%B5%E5%BA%A"
Do something
if tweepy.TweepError is "[{u'message': u'Over capacity', u'code': 130}]"
Do something
hatayı sınıflandırmak için tek yol var mı, Account update failed: Description is too long (maximum is 160 characters)
örneğin iple e
karşılaştırmaktır?