aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-01-15 22:49:23 -0800
committerBryan Newbold <bnewbold@archive.org>2020-01-15 22:49:34 -0800
commita8ada6d50e6522d1d8213b5aeb5662db9c96ed79 (patch)
treea09b5b69f35498e74deb2d244e0b0a09708cdf16 /python
parent9acda8f48c0a2bb117600635df3b61c7f6272698 (diff)
downloadsandcrawler-a8ada6d50e6522d1d8213b5aeb5662db9c96ed79.tar.gz
sandcrawler-a8ada6d50e6522d1d8213b5aeb5662db9c96ed79.zip
make failed replay fetch an error, not assert error
Diffstat (limited to 'python')
-rw-r--r--python/sandcrawler/ia.py3
1 files changed, 2 insertions, 1 deletions
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))