Log errors importing or initializing download handlers

This commit is contained in:
Daniel Graña 2015-08-10 18:18:13 -03:00
parent d3804b3439
commit 15ccf79cad
1 changed files with 4 additions and 2 deletions

View File

@ -43,14 +43,16 @@ class DownloadHandlers(object):
'no handler available for that scheme'
return None
path = self._schemes[scheme]
try:
dhcls = load_object(self._schemes[scheme])
dhcls = load_object(path)
dh = dhcls(self._crawler_settings)
except NotConfigured as ex:
self._notconfigured[scheme] = str(ex)
return None
except Exception as ex:
logger.exception()
logger.exception('Loading "{}" for scheme "{}" handler'\
.format(path, scheme))
self._notconfigured[scheme] = str(ex)
return None
else: