diff --git a/tox_poetry_installer/_poetry.py b/tox_poetry_installer/_poetry.py index 0ee72e5..3b44044 100644 --- a/tox_poetry_installer/_poetry.py +++ b/tox_poetry_installer/_poetry.py @@ -37,7 +37,7 @@ try: from poetry.installation.operations.install import Install from poetry.poetry import Poetry from poetry.utils.env import VirtualEnv -except ImportError: +except ImportError as err: raise exceptions.PoetryNotInstalledError( - f"No version of Poetry could be imported under the current environment for '{sys.executable}'" + f"Failed to import a supported version of Poetry under the current environment '{sys.executable}': {err}" ) from None diff --git a/tox_poetry_installer/utilities.py b/tox_poetry_installer/utilities.py index 8fa6702..2bfeda8 100644 --- a/tox_poetry_installer/utilities.py +++ b/tox_poetry_installer/utilities.py @@ -46,9 +46,9 @@ def check_preconditions(venv: ToxVirtualEnv) -> "_poetry.Poetry": # # ``RuntimeError`` is dangerous to blindly catch because it can be (and in Poetry's case, # is) raised in many different places for different purposes. - except RuntimeError: + except RuntimeError as err: raise exceptions.SkipEnvironment( - "Project does not use Poetry for env management, skipping installation of locked dependencies" + f"Skipping installation of locked dependencies due to a Poetry error: {err}" ) from None