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
5 changes: 4 additions & 1 deletion src/specify_cli/authentication/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ def load_auth_config(
except OSError:
pass # stat failed — skip permission check

raw = json.loads(config_path.read_text(encoding="utf-8"))
try:
raw = json.loads(config_path.read_text(encoding="utf-8"))
except json.JSONDecodeError as exc:
raise ValueError(f"{config_path} contains invalid JSON: {exc}") from exc

if not isinstance(raw, dict):
raise ValueError(f"auth.json must be a JSON object, got {type(raw).__name__}")
Expand Down