5
私はtweepyを使ってtwitterアプリケーションを作成しています。 ユーザーがtweet/update profileなどを入力すると、エラーが発生します。私はエラーを分類し、ユーザーにもっと情報を与えたいと思っています。tweepy/twitter apiエラータイプ
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
はエラーを分類する唯一の方法は、例えば、文字列でAccount update failed: Description is too long (maximum is 160 characters)
をe
を比較することがありますか?