Catch URLError as well in urlopen_with_retry

This commit is contained in:
chrisww 2020-05-13 16:48:32 -04:00
parent 6c80915ef9
commit 9bb17d160e

View File

@ -416,6 +416,10 @@ def urlopen_with_retry(*args, **kwargs):
logging.debug('HTTP Error with code{}'.format(http_error.code))
if i + 1 == retry_time:
raise http_error
except error.URLError as url_error:
logging.debug('URL Error: {}'.format(url_error))
if i + 1 == retry_time:
raise url_error
def get_content(url, headers={}, decoded=True):