fix downloader error handling
RequestException being a subclass of OSError caused all exceptions during file downloads to be ignored/re-raised.
This commit is contained in:
@@ -12,6 +12,7 @@ import os
|
|||||||
import time
|
import time
|
||||||
import logging
|
import logging
|
||||||
from .. import config, util
|
from .. import config, util
|
||||||
|
from requests.exceptions import RequestException
|
||||||
|
|
||||||
|
|
||||||
class DownloaderBase():
|
class DownloaderBase():
|
||||||
@@ -101,9 +102,7 @@ class DownloaderBase():
|
|||||||
# download content
|
# download content
|
||||||
try:
|
try:
|
||||||
self.receive(file)
|
self.receive(file)
|
||||||
except OSError:
|
except RequestException as exc:
|
||||||
raise
|
|
||||||
except Exception as exc:
|
|
||||||
msg = exc
|
msg = exc
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user