Core: Improve import exception reporting

This commit is contained in:
Mike Auty
2023-03-11 17:32:46 +00:00
parent 46f56770af
commit 9216bab61b
+6 -1
View File
@@ -26,6 +26,7 @@ import importlib
import inspect
import logging
import os
import traceback
from typing import Any, Dict, Generator, List, Tuple, Type, TypeVar
from volatility3.framework import constants, interfaces
@@ -183,7 +184,11 @@ def import_file(module: str, path: str, ignore_errors: bool = False) -> List[str
try:
importlib.import_module(module)
except ImportError as e:
vollog.debug(str(e))
vollog.debug(
"".join(
traceback.TracebackException.from_exception(e).format(chain=True)
)
)
vollog.debug(
"Failed to import module {} based on file: {}".format(module, path)
)