Configuration() sends a msg to user when config file not found
This commit is contained in:
parent
45341bb246
commit
152c4483c8
@ -51,8 +51,15 @@ class Configuration(object):
|
|||||||
:param path: path as str
|
:param path: path as str
|
||||||
:return: configuration as dictionary
|
:return: configuration as dictionary
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
with open(path) as file:
|
with open(path) as file:
|
||||||
conf = json.load(file)
|
conf = json.load(file)
|
||||||
|
except FileNotFoundError:
|
||||||
|
self.logger.critical(
|
||||||
|
'Config file "%s" not found. Please create your config file',
|
||||||
|
path
|
||||||
|
)
|
||||||
|
exit(0)
|
||||||
|
|
||||||
if 'internals' not in conf:
|
if 'internals' not in conf:
|
||||||
conf['internals'] = {}
|
conf['internals'] = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user