mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-09 10:04:17 +00:00
display clean exception when config file not found (#171)
This commit is contained in:
@@ -82,6 +82,12 @@ class CfgYaml:
|
|||||||
self.log = Logger()
|
self.log = Logger()
|
||||||
self.dirty = False
|
self.dirty = False
|
||||||
|
|
||||||
|
if not os.path.exists(path):
|
||||||
|
err = 'invalid config path: \"{}\"'.format(path)
|
||||||
|
if self.debug:
|
||||||
|
self.log.dbg(err)
|
||||||
|
raise YamlException(err)
|
||||||
|
|
||||||
self.yaml_dict = self._load_yaml(self.path)
|
self.yaml_dict = self._load_yaml(self.path)
|
||||||
# live patch deprecated entries
|
# live patch deprecated entries
|
||||||
self._fix_deprecated(self.yaml_dict)
|
self._fix_deprecated(self.yaml_dict)
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ class Options(AttrMonitor):
|
|||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
return path
|
return path
|
||||||
|
|
||||||
return None
|
return ''
|
||||||
|
|
||||||
def _header(self):
|
def _header(self):
|
||||||
"""display the header"""
|
"""display the header"""
|
||||||
|
|||||||
Reference in New Issue
Block a user