From a8ada6d50e6522d1d8213b5aeb5662db9c96ed79 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 15 Jan 2020 22:49:23 -0800 Subject: make failed replay fetch an error, not assert error --- python/sandcrawler/ia.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/sandcrawler/ia.py b/python/sandcrawler/ia.py index 058f4ca..8895500 100644 --- a/python/sandcrawler/ia.py +++ b/python/sandcrawler/ia.py @@ -406,7 +406,8 @@ class WaybackClient: #print(resp.url, file=sys.stderr) # defensively check that this is actually correct replay based on headers - assert "X-Archive-Src" in resp.headers + if not "X-Archive-Src" in resp.headers: + raise WaybackError("replay fetch didn't return X-Archive-Src in headers") if not datetime in resp.url: raise WaybackError("didn't get exact reply (redirect?) datetime:{} got:{}".format(datetime, resp.url)) -- cgit v1.2.3