summaryrefslogtreecommitdiff
path: root/crocoite/cli.py
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2019-03-16 17:16:51 +0100
committerLars-Dominik Braun <lars@6xq.net>2019-03-16 17:17:46 +0100
commitb0e31340b4551d997a8895fd9294b253ddf69dc5 (patch)
treec4614accf1470bf92a6c941d20b5cf1de5f2cced /crocoite/cli.py
parent810f9b3fdfb729b23e77de13497f711b1e78d15e (diff)
downloadcrocoite-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.py5
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',