1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-05 03:19:43 +00:00

display clean exception when config file not found (#171)

This commit is contained in:
deadc0de6
2019-06-23 11:53:42 +02:00
parent b4ce41a6fb
commit 8902cd3cf4
2 changed files with 7 additions and 1 deletions

View File

@@ -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)

View File

@@ -170,7 +170,7 @@ class Options(AttrMonitor):
if os.path.exists(path):
return path
return None
return ''
def _header(self):
"""display the header"""