diff --git a/md_pdf/config/read.py b/md_pdf/config/read.py index 2ae0bcd..6d32c95 100644 --- a/md_pdf/config/read.py +++ b/md_pdf/config/read.py @@ -2,8 +2,12 @@ import yaml from dotmap import DotMap import os from md_pdf.consts import CONFIG_FILE +from md_pdf.exceptions import ConfigValidationException def load_config(): - with open(os.path.join(CONFIG_FILE)) as f: - return DotMap(yaml.load(f)) + try: + with open(os.path.join(CONFIG_FILE)) as f: + return DotMap(yaml.load(f)) + except FileNotFoundError: + raise ConfigValidationException("Can't find config file at {}".format(CONFIG_FILE))