diff --git a/mpsd-software-environment.py b/mpsd-software-environment.py index 0b8ca746f27e1b0b0a50a1dbf46e6e206cfad372..7653de779f1ecc84c85c3012c37e803d7a8ee0e0 100755 --- a/mpsd-software-environment.py +++ b/mpsd-software-environment.py @@ -188,14 +188,14 @@ def get_release_info(mpsd_release: str, script_dir: Path) -> Tuple[str, str, Lis Raises ------ - Exception : + 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): @@ -271,7 +271,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 @@ -309,7 +309,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}." )