From e17936158a97fa3a9ca2252af49f84fc932df877 Mon Sep 17 00:00:00 2001 From: Bellman <54757707+Yeachan-Heo@users.noreply.github.com> Date: Thu, 28 May 2026 08:06:28 +0900 Subject: [PATCH] fix: make cc2 validator board read errors concise (#3175) --- scripts/validate_cc2_board.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/validate_cc2_board.py b/scripts/validate_cc2_board.py index b0a591cd..643326a4 100755 --- a/scripts/validate_cc2_board.py +++ b/scripts/validate_cc2_board.py @@ -44,7 +44,14 @@ def main() -> int: args = parser.parse_args() repo_root = args.repo_root.resolve() board_path = args.board or (repo_root / ".omx" / "cc2" / "board.json") - board = json.loads(board_path.read_text(encoding="utf-8")) + try: + board = json.loads(board_path.read_text(encoding="utf-8")) + except FileNotFoundError: + print(f"error: board not found at {board_path}") + return 1 + except json.JSONDecodeError as exc: + print(f"error: invalid board JSON at {board_path}: {exc}") + return 1 errors: list[str] = [] ids = set() for index, item in enumerate(board.get("items", []), 1):