From 08a0725f7d4c34ef073110c30117ae520d081a01 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Fri, 7 Aug 2020 08:50:06 -0500 Subject: Remove all custom exceptions except ParsingError --- config_file/exceptions.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/config_file/exceptions.py b/config_file/exceptions.py index a8b8e5c..f68b7e8 100644 --- a/config_file/exceptions.py +++ b/config_file/exceptions.py @@ -1,19 +1,9 @@ -class ConfigFileError(Exception): - """A generic error from the package.""" - - -class UnsupportedFileTypeError(ConfigFileError): +class ParsingError(ValueError): """ - A missing file extension or a file type not supported. - """ - + Unable to parse the configuration file. -class ParsingError(ConfigFileError): - """Unable to parse the configuration file.""" - - -class MissingKeyError(ParsingError): - """ - A key that was specified (to retrieve, delete, etc.) - is not in the file. + Since every module that parses the different + files has it's own decode error, this standardizes + it for the package to only raise a ParsingError + if a error occurs in those instances. """ -- cgit v1.2.3