Skip to content

Commit dda5b14

Browse files
committed
updated
1 parent 0456686 commit dda5b14

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

scripts/validate_installer_bundle.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ def _is_within(path: Path, root: Path) -> bool:
4545

4646
def _load_json_file(path: Path) -> dict[str, Any]:
4747
try:
48-
return json.loads(path.read_text(encoding="utf-8"))
48+
contents = path.read_text(encoding="utf-8")
49+
except OSError as exc:
50+
raise SystemExit(f"Failed to read JSON file {path}: {exc}") from exc
51+
52+
try:
53+
return json.loads(contents)
4954
except json.JSONDecodeError as exc:
5055
raise SystemExit(
5156
f"Invalid JSON in {path}: {exc.msg} (line {exc.lineno}, column {exc.colno})"

0 commit comments

Comments
 (0)