mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-05 05:04:46 +00:00
Add ability to error out of link checking with a predefined interrupt exception.
This commit is contained in:
parent
59ffbd43f0
commit
475e40b599
2 changed files with 6 additions and 1 deletions
|
|
@ -76,6 +76,9 @@ class LinkCheckerError (StandardError):
|
|||
"""Exception to be raised on linkchecker-specific check errors."""
|
||||
pass
|
||||
|
||||
class LinkCheckerInterrupt (StandardError):
|
||||
"""Used for testing."""
|
||||
pass
|
||||
|
||||
def add_intern_pattern (url_data, config):
|
||||
"""Add intern URL regex to config."""
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ Management of checking a queue of links with several threads.
|
|||
import time
|
||||
import os
|
||||
import thread
|
||||
from .. import log, LOG_CHECK
|
||||
from .. import log, LOG_CHECK, LinkCheckerInterrupt
|
||||
from ..cache import urlqueue, robots_txt, cookie, connection
|
||||
from . import aggregator, console
|
||||
|
||||
|
|
@ -37,6 +37,8 @@ def check_urls (aggregate):
|
|||
check_url(aggregate)
|
||||
aggregate.finish()
|
||||
aggregate.logger.end_log_output()
|
||||
except LinkCheckerInterrupt:
|
||||
raise
|
||||
except KeyboardInterrupt:
|
||||
interrupt(aggregate)
|
||||
except thread.error:
|
||||
|
|
|
|||
Loading…
Reference in a new issue