]> git.phdru.name Git - bookmarks_db.git/commitdiff
Report error if timeout is not an integer.
authorOleg Broytman <phd@phdru.name>
Sat, 19 Mar 2005 12:25:04 +0000 (12:25 +0000)
committerOleg Broytman <phd@phdru.name>
Sat, 19 Mar 2005 12:25:04 +0000 (12:25 +0000)
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@55 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

Robots/bkmk_rsimple.py

index 0d6c04409756be02fa161257b71729b68c2bd740..2a18beb72edad934fa1120c1f9e9fb3035130c75 100644 (file)
@@ -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