diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:22:58 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:22:58 +0100 |
commit | a35b33f4f1ddcf6f1bb8ab0f41b87bf2b847f11d (patch) | |
tree | fb220da28bb7248ebf37ce09af5de88f2c1aaad4 /bsie/utils/errors.py | |
parent | 7582c280ad5324a2f0427999911c7e7abc14a6ab (diff) | |
parent | af81318ae9311fd0b0e16949cef3cfaf7996970b (diff) | |
download | bsie-0.23.03.tar.gz bsie-0.23.03.tar.bz2 bsie-0.23.03.zip |
Diffstat (limited to 'bsie/utils/errors.py')
-rw-r--r-- | bsie/utils/errors.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/bsie/utils/errors.py b/bsie/utils/errors.py new file mode 100644 index 0000000..7c7e6ed --- /dev/null +++ b/bsie/utils/errors.py @@ -0,0 +1,44 @@ +"""Common BSIE exceptions. +""" +# standard imports +import typing + +# exports +__all__: typing.Sequence[str] = ( + 'BuilderError', + 'ExtractorError', + 'LoaderError', + 'ReaderError', + ) + + +## code ## + +class _BSIEError(Exception): + """Generic BSIE error.""" + +class BuilderError(_BSIEError): + """The Builder failed to create an instance.""" + +class LoaderError(BuilderError): + """Failed to load a module or class.""" + +class ExtractorError(_BSIEError): + """The Extractor failed to process the given content.""" + +class ReaderError(_BSIEError): + """The Reader failed to read the given file.""" + +class ProgrammingError(_BSIEError): + """An assertion-like error that indicates a code-base issue.""" + +class UnreachableError(ProgrammingError): + """Bravo, you've reached a point in code that should logically not be reachable.""" + +class ParserError(_BSIEError): + """Failed to parse due to invalid syntax or structures.""" + +class UnsupportedFileFormatError(_BSIEError): + """Failed to read a file format.""" + +## EOF ## |