Plugins disco: catch PluginError in prepare(), debug log exceptions.

This commit is contained in:
Jakub Warmuz 2015-06-27 08:14:00 +00:00
parent 62e7eb236d
commit b7a19486ed
No known key found for this signature in database
GPG key ID: 2A7BAD3A489B52EA

View file

@ -75,7 +75,7 @@ class PluginEntryPoint(object):
if iface.implementedBy(self.plugin_cls):
logger.debug(
"%s implements %s but object does not verify: %s",
self.plugin_cls, iface.__name__, error)
self.plugin_cls, iface.__name__, error, exc_info=True)
return False
return True
@ -93,10 +93,14 @@ class PluginEntryPoint(object):
try:
self._initialized.prepare()
except errors.MisconfigurationError as error:
logger.debug("Misconfigured %r: %s", self, error)
logger.debug("Misconfigured %r: %s", self, error, exc_info=True)
self._prepared = error
except errors.NoInstallationError as error:
logger.debug("No installation (%r): %s", self, error)
logger.debug(
"No installation (%r): %s", self, error, exc_info=True)
self._prepared = error
except errors.PluginError as error:
logger.debug("Other error:(%r): %s", self, error, exc_info=True)
self._prepared = error
else:
self._prepared = True