Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/specify_cli/bundler/services/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down