catch max recusion limit error

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@573 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2002-10-19 11:46:41 +00:00
parent 288c7b8800
commit 5be54dab72

View file

@ -259,7 +259,7 @@ class UrlData:
try:
self._check()
except KeyboardInterrupt:
pass
raise
except (socket.error, select.error):
# on Unix, ctrl-c can raise
# error: (4, 'Interrupted system call')
@ -501,7 +501,14 @@ class UrlData:
else:
tag = ''
while 1:
match = pattern['pattern'].search(self.getContent(), index)
try:
match = pattern['pattern'].search(self.getContent(), index)
except RuntimeError, msg:
self.setError(linkcheck._("""Could not parse HTML content (%s).
You may have a syntax error.
LinkChecker is skipping the remaining content for the link type
<%s %s>.""") % (msg, "|".join(pattern['tags']), "|".join(pattern['attrs'])))
break
if not match: break
index = match.end()
if self.is_in_comment(match.start()): continue