From abca07fd82705df1a8a406990e0d7250b3c2d43d Mon Sep 17 00:00:00 2001 From: Alasdair Mostyn Date: Tue, 31 Mar 2026 16:26:00 +0100 Subject: [PATCH] Explain: Fix to raise Exception if agent is missing --- explain/agents.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/explain/agents.py b/explain/agents.py index 37e4028..513f1d6 100644 --- a/explain/agents.py +++ b/explain/agents.py @@ -49,7 +49,7 @@ def find_binary(cls) -> Path | None: Path to the agent binary, or None if not found Raises: - FileNotFoundError: If the EXPLAIN_{AGENT}_PATH environment variable is set but the path + Exception: If the EXPLAIN_{AGENT}_PATH environment variable is set but the path could not be found """ env_var = f"EXPLAIN_{cls.name.upper()}_PATH" @@ -57,7 +57,7 @@ def find_binary(cls) -> Path | None: if loc := shutil.which(program): return Path(loc).absolute() if os.environ.get(env_var): - raise FileNotFoundError(f"{env_var} is set to {program!r} but it could not be found.") + raise Exception(f"{env_var} is set to {program!r} but it could not be found.") return None @abstractmethod