2020-10-08 18:46:45 +02:00
|
|
|
import json
|
|
|
|
|
|
|
|
|
|
|
|
def load_config(config_path, logger=None):
|
|
|
|
try:
|
|
|
|
with open(config_path, "rt") as config_file:
|
|
|
|
return json.load(config_file)
|
2020-10-09 16:03:09 +02:00
|
|
|
except (OSError, json.decoder.JSONDecodeError) as exc:
|
2020-10-08 18:46:45 +02:00
|
|
|
logger.critical(f"Could not load config file: {exc}")
|
2020-10-09 16:03:09 +02:00
|
|
|
exit()
|