1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-06 10:50:51 +01:00

utils/misc: attach exc_info on error in walk_modules

Commit 28891a82 made it easier to debug issues during walk_modules by
attaching the specific name of the module being loaded to the exception.
However, the error may not originite in the imported module, but one of
the modules that module itself is importing.

To further facilitate debugging, exc_info (which contains the traceback)
for the orginal ImportError is now also attached to the raised
HostError.
This commit is contained in:
Sergei Trofimov 2017-02-23 09:13:05 +00:00
parent 23087d14f5
commit 1dd6950177

View File

@ -186,6 +186,7 @@ def walk_modules(path):
except Exception as e:
he = HostError('Could not load {}: {}'.format(path, str(e)))
he.module = path
he.exc_info = sys.exc_info()
he.orig_exc = e
raise he