From: Oleg Broytman Date: Sat, 19 Mar 2005 12:25:04 +0000 (+0000) Subject: Report error if timeout is not an integer. X-Git-Tag: v4.5.3~321 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=199a8ce519d73ee4e7629657b2119b3213efb3e9;hp=2c65839921df4ae5991682ed24d743a3672b3d89;p=bookmarks_db.git 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 --- 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