Handled more error cases gracefully

This commit is contained in:
Anna 2010-04-20 15:49:33 -04:00
parent 7d9f8f8d7f
commit 97daaedf6c

View File

@ -330,14 +330,20 @@ class MyTwitter():
# Name is the name of a pane, with the 'user: ' in place
def check_following(self, name):
screen_name = re.sub('user: ', '', name)
try:
relationship = self.api.ShowFriendships(target_screen_name=screen_name)
except HTTPError:
return False
return relationship.source.following
# Name is the name of a pane, with the 'user: ' in place
def check_verified(self, name):
screen_name = re.sub('user: ', '', name)
try:
user = self.api.GetUser(screen_name)
except HTTPError:
return False
return user.verified