From 4dcbeb2d044041bd8cfb169374474e8f80ebf989 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sun, 8 Nov 2020 22:19:46 -0800 Subject: html: handle more traf error cases --- python/sandcrawler/html_ingest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/python/sandcrawler/html_ingest.py b/python/sandcrawler/html_ingest.py index 50b193c..7594365 100644 --- a/python/sandcrawler/html_ingest.py +++ b/python/sandcrawler/html_ingest.py @@ -25,10 +25,10 @@ def html_extract_body_teixml(doc: bytes) -> dict: include_comments=False, include_formatting=True, ) - except ValueError as ve: + except (ValueError, TypeError) as e: return dict( status="parse-error", - error_msg=str(ve)[:1000], + error_msg=str(e)[:1000], ) if tei_xml: body_txt = teixml_body_text(tei_xml) -- cgit v1.2.3