mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
News download: Retry article download if temporary failure in DNS
This commit is contained in:
parent
f4f6d4d728
commit
a031f04e91
@ -212,7 +212,8 @@ class RecursiveFetcher(object):
|
||||
if hasattr(err, 'code') and responses.has_key(err.code):
|
||||
raise FetchError, responses[err.code]
|
||||
if getattr(err, 'reason', [0])[0] == 104 or \
|
||||
getattr(getattr(err, 'args', [None])[0], 'errno', None) == -2: # Connection reset by peer or Name or service not know
|
||||
getattr(getattr(err, 'args', [None])[0], 'errno', None) in (-2,
|
||||
-3): # Connection reset by peer or Name or service not know
|
||||
self.log.debug('Temporary error, retrying in 1 second')
|
||||
time.sleep(1)
|
||||
with closing(open_func(url, timeout=self.timeout)) as f:
|
||||
|
Loading…
x
Reference in New Issue
Block a user