Skip to content

Commit

Permalink
[DP_PlexLibrary] shown more detailed errors, also add timeout for aut…
Browse files Browse the repository at this point in the history
…o close. fixed #141
  • Loading branch information
Andy Blackburn committed Feb 1, 2014
1 parent 5061b3b commit ca12ae9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/DP_PlexLibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,9 +929,16 @@ def getNewMyPlexToken(self):
token = etree.fromstring(response).findtext('authentication-token')
except Exception:
self._showErrorOnTv("no xml as response", response)

if token is None:
self._showErrorOnTv("", response)
try:
error = etree.fromstring(response).findtext('error')
if error:
self._showErrorOnTv("", error.replace('email, ',''))
else:
self._showErrorOnTv("", response)
except:
self._showErrorOnTv("", response)

printl("", self, "C")
return False
Expand Down Expand Up @@ -2770,7 +2777,7 @@ def buildContextMenu(self, url, itemData ):
def _showErrorOnTv(self, text, content):
printl("", self, "S")

self.session.open(MessageBox,_("UNEXPECTED ERROR:") + ("\n%s\n%s") % (text, content), MessageBox.TYPE_INFO)
self.session.open(MessageBox,_("UNEXPECTED ERROR:") + ("\n%s\n%s") % (text, content), MessageBox.TYPE_ERROR, timeout=15)

printl("", self, "C")

Expand Down

0 comments on commit ca12ae9

Please sign in to comment.