mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-05 12:38:50 +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.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)
|
||||
# live patch deprecated entries
|
||||
self._fix_deprecated(self.yaml_dict)
|
||||
|
||||
@@ -170,7 +170,7 @@ class Options(AttrMonitor):
|
||||
if os.path.exists(path):
|
||||
return path
|
||||
|
||||
return None
|
||||
return ''
|
||||
|
||||
def _header(self):
|
||||
"""display the header"""
|
||||
|
||||
Reference in New Issue
Block a user