Improve the message for errors in package recipes (#37589)
fixes #30355
This commit is contained in:
parent
297329f4b5
commit
8da29d1231
@ -1240,6 +1240,9 @@ def get_pkg_class(self, pkg_name):
|
|||||||
module = importlib.import_module(fullname)
|
module = importlib.import_module(fullname)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise UnknownPackageError(pkg_name)
|
raise UnknownPackageError(pkg_name)
|
||||||
|
except Exception as e:
|
||||||
|
msg = f"cannot load package '{pkg_name}' from the '{self.namespace}' repository: {e}"
|
||||||
|
raise RepoError(msg) from e
|
||||||
|
|
||||||
cls = getattr(module, class_name)
|
cls = getattr(module, class_name)
|
||||||
if not inspect.isclass(cls):
|
if not inspect.isclass(cls):
|
||||||
|
Loading…
Reference in New Issue
Block a user