aboutsummaryrefslogtreecommitdiffstats
path: root/config_file
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2020-08-06 09:47:35 -0500
committerEugene Triguba <eugenetriguba@gmail.com>2020-08-06 09:47:35 -0500
commit836cefe45633331d0e5692295174bf3181a5e365 (patch)
tree8602b312e67cc591f33022f56221ca7434cfe33f /config_file
parentUpdate README example to remove MissingKeyError (diff)
downloadconfig-file-836cefe45633331d0e5692295174bf3181a5e365.zip
Change MissingKeyErrors to KeyError
Diffstat (limited to 'config_file')
-rw-r--r--config_file/abstract_parser.py4
-rw-r--r--config_file/base_parser.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/config_file/abstract_parser.py b/config_file/abstract_parser.py
index ab5d205..689fece 100644
--- a/config_file/abstract_parser.py
+++ b/config_file/abstract_parser.py
@@ -57,7 +57,7 @@ class AbstractParser(ABC):
Whatever value the given key happens to contain.
Raises:
- MissingKeyError: If the key to retrieve does not exist.
+ KeyError: If the key to retrieve does not exist.
"""
raise NotImplementedError
@@ -81,7 +81,7 @@ class AbstractParser(ABC):
key: The key we would like to remove.
Raises:
- MissingKeyError: If the key to remove does not exist.
+ KeyError: If the key to remove does not exist.
"""
raise NotImplementedError
diff --git a/config_file/base_parser.py b/config_file/base_parser.py
index a987a55..a440dcb 100644
--- a/config_file/base_parser.py
+++ b/config_file/base_parser.py
@@ -2,7 +2,7 @@ from types import ModuleType
from typing import Any, Type
from config_file.abstract_parser import AbstractParser
-from config_file.exceptions import MissingKeyError, ParsingError
+from config_file.exceptions import ParsingError
from config_file.nested_lookup import get_occurrence_of_key
from config_file.utils import split_on_dot
@@ -123,7 +123,7 @@ class BaseParser(AbstractParser):
content_reference = content_reference[key]
except (KeyError, TypeError):
- raise MissingKeyError(f"The specified key '{key}' to delete was not found.")
+ raise KeyError(f"The specified key '{key}' to delete was not found.")
def stringify(self) -> str:
return self.__module.dumps(self.parsed_content)