diff --git a/src/specify_cli/bundler/services/adapters.py b/src/specify_cli/bundler/services/adapters.py index f6a1d466ba..ba961a1d02 100644 --- a/src/specify_cli/bundler/services/adapters.py +++ b/src/specify_cli/bundler/services/adapters.py @@ -143,15 +143,17 @@ def fetch(source: CatalogSource) -> dict: if scheme == "file": path = _file_url_to_path(parsed) - if not path.exists(): - raise BundlerError(f"Catalog file not found: {path}") - return loads_json(path.read_text(encoding="utf-8"), origin=str(path)) + try: + return loads_json(path.read_text(encoding="utf-8"), origin=str(path)) + except FileNotFoundError: + raise BundlerError(f"Catalog file not found: {path}") from None if scheme == "" or _is_windows_drive_path(url): path = Path(url) - if not path.exists(): - raise BundlerError(f"Catalog file not found: {path}") - return loads_json(path.read_text(encoding="utf-8"), origin=str(path)) + try: + return loads_json(path.read_text(encoding="utf-8"), origin=str(path)) + except FileNotFoundError: + raise BundlerError(f"Catalog file not found: {path}") from None if scheme in ("http", "https"): if not allow_network: