mirror of
https://github.com/ultraworkers/claw-code.git
synced 2026-05-30 03:35:20 +08:00
fix: make cc2 validator board read errors concise (#3175)
This commit is contained in:
parent
760e69675c
commit
e17936158a
@ -44,7 +44,14 @@ def main() -> int:
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
repo_root = args.repo_root.resolve()
|
repo_root = args.repo_root.resolve()
|
||||||
board_path = args.board or (repo_root / ".omx" / "cc2" / "board.json")
|
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] = []
|
errors: list[str] = []
|
||||||
ids = set()
|
ids = set()
|
||||||
for index, item in enumerate(board.get("items", []), 1):
|
for index, item in enumerate(board.get("items", []), 1):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user