मैं ट्विटर एप्लिकेशन बनाने के लिए tweepy का उपयोग कर रहा हूँ। जब उपयोगकर्ता प्रोफ़ाइल को ट्वीट/अपडेट करते हैं, तो उन्हें कुछ त्रुटियां मिलेंगी। मैं त्रुटि वर्गीकृत करना चाहता हूं और उपयोगकर्ता को अधिक जानकारी देना चाहता हूं।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
त्रुटि वर्गीकृत करने के लिए एक ही रास्ता है तार के साथ e
तुलना करने के लिए, उदाहरण के लिए, Account update failed: Description is too long (maximum is 160 characters)
के लिए है?