ViewProfile: Show error for suspended accounts

This commit is contained in:
Manuel Cortez 2017-02-01 09:03:22 -06:00
parent ad9f2452b2
commit 20c2f844f5
2 changed files with 6 additions and 1 deletions

View File

@ -5,7 +5,7 @@
* Fixed a bug in long tweet parsing that was making TWBlue to disconnect the streaming API. [#103](https://github.com/manuelcortez/TWBlue/issues/103)
* Now OCR will work in images from retweets. It fixes a bug where TWBlue was detecting images but couldn't apply OCR on them. [#105](https://github.com/manuelcortez/TWBlue/issues/105)
* TWBlue won't try to load tweets already deleted, made with Twishort. Before, if someone posted a long tweet but deleted it in the Twishort's site, TWBlue was trying to load the tweet and it was causing problems in all the client. [#113](https://github.com/manuelcortez/TWBlue/issues/113)
* TWBlue shows an error message when you try to view the profile of a user that does not exist. [#114](https://github.com/manuelcortez/TWBlue/issues/114)
* TWBlue shows an error message when you try to view the profile of a user that does not exist or has been suspended. [#114,](https://github.com/manuelcortez/TWBlue/issues/114) [#115](https://github.com/manuelcortez/TWBlue/issues/115)
## Changes in version 0.88 and 0.89

View File

@ -4,6 +4,8 @@ import webbrowser
import widgetUtils
import output
from wxUI.dialogs import update_profile, show_user
import logging
log = logging.getLogger("controller.user")
from twython import TwythonError
class profileController(object):
@ -24,6 +26,9 @@ class profileController(object):
except TwythonError as err:
if err.error_code == 404:
wx.MessageDialog(None, _(u"That user does not exist"), _(u"Error"), wx.ICON_ERROR).ShowModal()
if err.error_code == 403:
wx.MessageDialog(None, _(u"User has been suspended"), _(u"Error"), wx.ICON_ERROR).ShowModal()
log.error("error %d: %s" % (err.error_code, err.msg))
return
self.dialog = show_user.showUserProfile()
string = self.get_user_info()