15 lines
419 B
Python
15 lines
419 B
Python
|
import json
|
||
|
import logging
|
||
|
|
||
|
def load_config():
|
||
|
try:
|
||
|
with open('./config.json', encoding="utf_8") as config_file:
|
||
|
data = json.load(config_file)
|
||
|
return data
|
||
|
except FileNotFoundError:
|
||
|
logging.fatal("The configuration file was not found.")
|
||
|
return None
|
||
|
except json.JSONDecodeError as e:
|
||
|
logging.fatal("Error decoding the JSON file: %s", e)
|
||
|
return None
|