diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-08-01 11:56:44 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2020-08-01 11:56:44 -0500 |
| commit | 3fa2561f16f684bb83aa9b3dcacb44171b04ddc5 (patch) | |
| tree | c864270a1f188371769f87cfa257a352be023272 /config_file/utils.py | |
| parent | Expand on docstrings for parse_value file (diff) | |
| download | config-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.py | 5 |
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 |