diff --git a/mpsd-software-environment.py b/mpsd-software-environment.py index ba01d626e7ca91c081ee3251593fedda01d42a8b..8db833a2128ced6c9f328065e11e510af4e7cf90 100755 --- a/mpsd-software-environment.py +++ b/mpsd-software-environment.py @@ -173,13 +173,13 @@ def get_release_info(mpsd_release: str, script_dir: Path) -> Tuple[str, str, Lis toolchains for the release. Raises: - - Exception: If the release directory does not exist. Run `create_dir_structure()` - first. + - FileNotFoundError: If the release directory does not exist. Run + `create_dir_structure()` first. """ # Get the info for release release_base_dir = script_dir / mpsd_release if not os.path.exists(release_base_dir): - raise Exception( + raise FileNotFoundError( "Release directory does not exist. Run create_dir_structure() first." ) with os_chdir(release_base_dir): @@ -254,7 +254,7 @@ def install_environment( cache when installing toolchains. Defaults to False. Raises: - Exception: If a requested toolchain is not available in the specified release. + ValueError: If a requested toolchain is not available in the specified release. Returns: None @@ -292,7 +292,7 @@ def install_environment( for toolchain in toolchains: if toolchain not in available_toolchains: - raise Exception( + raise ValueError( f"Toolchain '{toolchain}' is not available in release {mpsd_release}." )