aboutsummaryrefslogtreecommitdiffstats
path: root/config_file/utils.py
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2020-08-01 11:56:44 -0500
committerEugene Triguba <eugenetriguba@gmail.com>2020-08-01 11:56:44 -0500
commit3fa2561f16f684bb83aa9b3dcacb44171b04ddc5 (patch)
treec864270a1f188371769f87cfa257a352be023272 /config_file/utils.py
parentExpand on docstrings for parse_value file (diff)
downloadconfig-file-3fa2561f16f684bb83aa9b3dcacb44171b04ddc5.zip
Raise FileNotFoundError if the config file does not exist
Diffstat (limited to 'config_file/utils.py')
-rw-r--r--config_file/utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/config_file/utils.py b/config_file/utils.py
index a75968c..4d8bb36 100644
--- a/config_file/utils.py
+++ b/config_file/utils.py
@@ -39,6 +39,11 @@ def create_config_path(file_path: Path, original: bool = False) -> Path:
if file_path.is_dir():
raise ValueError(f"The specified config file ({file_path}) is a directory.")
+ if not file_path.exists():
+ raise FileNotFoundError(
+ f"The specified config file ({file_path}) does not exist."
+ )
+
return file_path