error if we cannot load a dataclass from file

This commit is contained in:
Jörg Thalheim
2024-10-01 15:34:58 +02:00
committed by Mic92
parent ca4ff0611c
commit 9c25b4d61c

View File

@@ -129,6 +129,9 @@ def test_all_dataclasses() -> None:
try:
API.reset()
dclass = load_dataclass_from_file(file, dataclass, str(cli_path.parent))
if dclass is None:
msg = f"Could not load dataclass {dataclass} from {file}"
raise ClanError(msg)
type_to_dict(dclass)
except JSchemaTypeError as e:
print(f"Error loading dataclass {dataclass} from {file}: {e}")