Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _load_item(self, item_json: Dict) -> None:
"""Convert the `item_json` into a :class:`ItemProperties` and store it.
:param item_json: A dict from an open and loaded JSON file.
:raises ValueError: Cannot populate item.
"""
# Load the item using the ItemProperties class
try:
item_def = ItemProperties.from_json(item_json)
except TypeError as e:
raise ValueError("Error: Invalid JSON structure found, check supplied input. Exiting") from e
# Add item to list
self.all_items.append(item_def)
self.all_items_dict[item_def.id] = item_def