Skip to content

Commit

Permalink
Raise errors if can't find schema.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwatkot committed Feb 17, 2025
1 parent 3b29011 commit 0eafff5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions webui/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ def get_schema(game_code: str, schema_type: Literal["texture", "tree"]) -> list[
list[dict[str, Any]]: The schema for the specified game and schema type.
"""
schema_path = os.path.join(DATA_DIRECTORY, f"{game_code}-{schema_type}-schema.json")

if not os.path.isfile(schema_path):
raise FileNotFoundError(f"{schema_type} for {game_code} not found in {schema_path}.")

with open(schema_path, "r", encoding="utf-8") as f:
schema = json.load(f)
return schema
Expand Down

0 comments on commit 0eafff5

Please sign in to comment.