mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00: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:
parent
23087d14f5
commit
1dd6950177
@ -186,6 +186,7 @@ def walk_modules(path):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
he = HostError('Could not load {}: {}'.format(path, str(e)))
|
he = HostError('Could not load {}: {}'.format(path, str(e)))
|
||||||
he.module = path
|
he.module = path
|
||||||
|
he.exc_info = sys.exc_info()
|
||||||
he.orig_exc = e
|
he.orig_exc = e
|
||||||
raise he
|
raise he
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user