diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2019-03-16 17:16:51 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2019-03-16 17:17:46 +0100 |
commit | b0e31340b4551d997a8895fd9294b253ddf69dc5 (patch) | |
tree | c4614accf1470bf92a6c941d20b5cf1de5f2cced /crocoite/cli.py | |
parent | 810f9b3fdfb729b23e77de13497f711b1e78d15e (diff) | |
download | crocoite-b0e31340b4551d997a8895fd9294b253ddf69dc5.tar.gz crocoite-b0e31340b4551d997a8895fd9294b253ddf69dc5.tar.bz2 crocoite-b0e31340b4551d997a8895fd9294b253ddf69dc5.zip |
browser: Raise exception if navigation failed
Stop early if there’s nothing to do.
Diffstat (limited to 'crocoite/cli.py')
-rw-r--r-- | crocoite/cli.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crocoite/cli.py b/crocoite/cli.py index 0595eb9..fb9060d 100644 --- a/crocoite/cli.py +++ b/crocoite/cli.py @@ -32,7 +32,7 @@ try: except ModuleNotFoundError: pass -from . import behavior +from . import behavior, browser from .controller import SinglePageController, \ ControllerSettings, StatsHandler, LogHandler, \ RecursiveController, DepthLimit, PrefixLimit @@ -47,6 +47,7 @@ class SingleExitStatus(IntEnum): Ok = 0 Fail = 1 BrowserCrash = 2 + Navigate = 3 def single (): parser = argparse.ArgumentParser(description='Save website to WARC using Google Chrome.') @@ -90,6 +91,8 @@ def single (): except asyncio.CancelledError: # don’t log this one pass + except browser.NavigateError: + ret = SingleExitStatus.Navigate except Exception as e: ret = SingleExitStatus.Fail logger.error ('cli exception', |