1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

target: Improve error reporting of module installation

If an Exception occurs when installing a module log it explicitly to
make it clearer to the user what went wrong.
This commit is contained in:
Marc Bonnici 2019-10-21 17:58:43 +01:00
parent 249b8336b5
commit 76ef9e0364

View File

@ -877,7 +877,11 @@ class Target(object):
def _install_module(self, mod, **params):
if mod.name not in self._installed_modules:
self.logger.debug('Installing module {}'.format(mod.name))
mod.install(self, **params)
try:
mod.install(self, **params)
except Exception as e:
self.logger.error('Module "{}" failed to install on target'.format(mod.name))
raise
self._installed_modules[mod.name] = mod
else:
self.logger.debug('Module {} is already installed.'.format(mod.name))