mirror of
https://github.com/soimort/you-get.git
synced 2025-02-11 04:32:27 +03:00
Catch URLError as well in urlopen_with_retry
This commit is contained in:
parent
6c80915ef9
commit
9bb17d160e
@ -416,6 +416,10 @@ def urlopen_with_retry(*args, **kwargs):
|
|||||||
logging.debug('HTTP Error with code{}'.format(http_error.code))
|
logging.debug('HTTP Error with code{}'.format(http_error.code))
|
||||||
if i + 1 == retry_time:
|
if i + 1 == retry_time:
|
||||||
raise http_error
|
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):
|
def get_content(url, headers={}, decoded=True):
|
||||||
|
Loading…
Reference in New Issue
Block a user