From 199a8ce519d73ee4e7629657b2119b3213efb3e9 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 19 Mar 2005 12:25:04 +0000 Subject: [PATCH] Report error if timeout is not an integer. git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@55 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23 --- Robots/bkmk_rsimple.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Robots/bkmk_rsimple.py b/Robots/bkmk_rsimple.py index 0d6c044..2a18beb 100644 --- a/Robots/bkmk_rsimple.py +++ b/Robots/bkmk_rsimple.py @@ -143,15 +143,18 @@ class robot_simple(Robot): if self.log: self.log(" final title : %s" % bookmark.real_title) if parser.refresh: refresh = parser.refresh - try: - timeout = int(refresh.split(';')[0]) - except (IndexError, ValueError): - timeout = "ERROR" try: url = refresh.split('=', 1)[1] except IndexError: url = "self" - raise RedirectException("html", "%s (%d sec)" % (url, timeout)) + try: + timeout = int(refresh.split(';')[0]) + except (IndexError, ValueError): + timeout = None + if timeout is None: + raise RedirectException("html", "Bad redirect to %s (%s)" % (url, refresh)) + else: + raise RedirectException("html", "%s (%d sec)" % (url, timeout)) except KeyError: pass -- 2.39.2