You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
310 B

import json
def load_config(config_path: str, logger=None) -> dict:
try:
with open(config_path, "rt") as config_file:
return json.load(config_file)
except (OSError, json.decoder.JSONDecodeError) as exc:
logger.critical(f"Could not load config file: {exc}")
exit()