blob: 5fafd5b4491c423ec23260367201ddb25c2e9483 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
"""Common BSIE exceptions.
Part of the bsie module.
A copy of the license is provided with the project.
Author: Matthias Baumgartner, 2022
"""
# 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."""
## EOF ##
|