diff --git a/airbyte/_factories/connector_factories.py b/airbyte/_factories/connector_factories.py index 5def9b77..0bd3c54f 100644 --- a/airbyte/_factories/connector_factories.py +++ b/airbyte/_factories/connector_factories.py @@ -2,6 +2,7 @@ from __future__ import annotations import shutil +import sys import warnings from pathlib import Path from typing import Any @@ -83,9 +84,18 @@ def get_source( # Assume this is a path local_executable = Path(local_executable).absolute() else: + if sys.platform == "win32": + local_executable = f"{local_executable}.exe" + which_executable = shutil.which(local_executable) if which_executable is None: - raise FileNotFoundError(local_executable) + raise exc.AirbyteConnectorExecutableNotFoundError( + connector_name=name, + context={ + "executable": local_executable, + "working_directory": Path.cwd().absolute(), + }, + ) from FileNotFoundError(local_executable) local_executable = Path(which_executable).absolute() print(f"Using local `{name}` executable: {local_executable!s}")