From 830e4f283035bed3f7a78e9354abe7ec488e7b11 Mon Sep 17 00:00:00 2001 From: Serene-Arc Date: Wed, 19 May 2021 10:07:55 +1000 Subject: [PATCH] Catch additional error --- bdfr/resource.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bdfr/resource.py b/bdfr/resource.py index 966f5ba..e660d33 100644 --- a/bdfr/resource.py +++ b/bdfr/resource.py @@ -5,8 +5,8 @@ import hashlib import logging import re import time -from typing import Optional import urllib.parse +from typing import Optional import _hashlib import requests @@ -39,7 +39,7 @@ class Resource: else: raise BulkDownloaderException( f'Unrecoverable error requesting resource: HTTP Code {response.status_code}') - except requests.exceptions.ConnectionError as e: + except (requests.exceptions.ConnectionError, requests.exceptions.ChunkedEncodingError) as e: logger.warning(f'Error occured downloading from {url}, waiting {wait_time} seconds: {e}') time.sleep(wait_time) if wait_time < max_wait_time: