mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-25 02:10:24 +00:00
catch all errors on url check
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2717 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
e7ca18403a
commit
bb2b227b13
1 changed files with 19 additions and 5 deletions
|
|
@ -100,6 +100,17 @@ acap # application configuration access protocol
|
|||
ignored_schemes_re = re.compile(ignored_schemes, re.VERBOSE)
|
||||
|
||||
|
||||
def abort (consumer):
|
||||
"""
|
||||
Try to abort consumer. Exit on errors.
|
||||
"""
|
||||
try:
|
||||
consumer.abort()
|
||||
except:
|
||||
# XXX print an error message?
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def check_urls (consumer):
|
||||
"""
|
||||
Main check function; checks all configured URLs until interrupted
|
||||
|
|
@ -114,10 +125,10 @@ def check_urls (consumer):
|
|||
try:
|
||||
_check_urls(consumer)
|
||||
except KeyboardInterrupt:
|
||||
try:
|
||||
consumer.abort()
|
||||
except:
|
||||
sys.exit(1)
|
||||
abort(consumer)
|
||||
except:
|
||||
abort(consumer)
|
||||
internal_error()
|
||||
|
||||
|
||||
def _check_urls (consumer):
|
||||
|
|
@ -147,7 +158,10 @@ def _check_urls (consumer):
|
|||
name = url_data.parent_url
|
||||
else:
|
||||
name = u""
|
||||
name += url_data.base_url
|
||||
if url_data.base_url:
|
||||
name += url_data.base_url
|
||||
if not name:
|
||||
name = None
|
||||
consumer.check_url(url_data, name)
|
||||
if consumer.config('status'):
|
||||
curtime = time.time()
|
||||
|
|
|
|||
Loading…
Reference in a new issue