From 96b5bef35ff08dca7e2f6f78cf161824b9ccf947 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Tue, 29 Oct 2013 00:14:43 -0400 Subject: [PATCH] Include error text in failed connect page; capture other errors for status text. --- plugins/togo/togo.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/plugins/togo/togo.py b/plugins/togo/togo.py index e068cc8..9f7f76f 100644 --- a/plugins/togo/togo.py +++ b/plugins/togo/togo.py @@ -45,7 +45,7 @@ from the queue.

""" UNABLE = """

Unable to Connect to TiVo

pyTivo was unable to connect to the TiVo at %s.

This is most likely caused by an incorrect Media Access Key. Please return to the Settings page and -double check your tivo_mak setting.

""" +double check your tivo_mak setting.

%s
""" # Preload the templates tnname = os.path.join(SCRIPTDIR, 'templates', 'npl.tmpl') @@ -124,7 +124,7 @@ class ToGo(Plugin): try: page = self.tivo_open(theurl) except IOError, e: - handler.redir(UNABLE % tivoIP, 10) + handler.redir(UNABLE % (tivoIP, e), 10) return tivo_cache[theurl] = {'thepage': minidom.parse(page), 'thepage_time': time.time()} @@ -260,13 +260,9 @@ class ToGo(Plugin): handle = self.tivo_open(url + '&Format=video/x-tivo-mpeg-ts') else: handle = self.tivo_open(url) - except urllib2.HTTPError, e: - status[url]['running'] = False - status[url]['error'] = e.code - return - except urllib2.URLError, e: + except Exception, msg: status[url]['running'] = False - status[url]['error'] = e.reason + status[url]['error'] = str(msg) return tivo_name = config.tivo_names[config.tivos_by_ip(tivoIP)] -- 2.11.4.GIT