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_prayer(self, prayer_json: Dict) -> None:
"""Convert the `prayer_json` into a :class:`PrayerProperties` and store it.
:param prayer_json: A dict from an open and loaded JSON file.
:raises ValueError: Cannot populate prayer.
"""
# Load the prayer using the PrayerProperties class
try:
prayer_def = PrayerProperties.from_json(prayer_json)
except TypeError as e:
raise ValueError("Error: Invalid JSON structure found, check supplied input. Exiting") from e
# Add prayer to list
self.all_prayers.append(prayer_def)
self.all_prayers_dict[prayer_def.id] = prayer_def