From 6a9c1fe64941b4975fa5e52fc3df58b38bf9a0f0 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 24 Feb 2020 16:50:50 -0800 Subject: ingest: treat CDX lookup error as a wayback-error --- python/sandcrawler/ia.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/sandcrawler/ia.py b/python/sandcrawler/ia.py index c3ca80f..7230ee0 100644 --- a/python/sandcrawler/ia.py +++ b/python/sandcrawler/ia.py @@ -381,7 +381,10 @@ class WaybackClient: revisit_uri = revisit_uri.decode('utf-8') revisit_dt = revisit_dt.decode('utf-8').replace('-', '').replace(':', '').replace('T', '').replace('Z', '') assert len(revisit_dt) == 14 - revisit_cdx = self.cdx_client.fetch(revisit_uri, revisit_dt) + try: + revisit_cdx = self.cdx_client.fetch(revisit_uri, revisit_dt) + except KeyError as ke: + raise WaybackError("Revist resolution failed: {}".format(ke)) body = self.fetch_petabox_body( csize=revisit_cdx.warc_csize, offset=revisit_cdx.warc_offset, -- cgit v1.2.3