-
Notifications
You must be signed in to change notification settings - Fork 48
/
exceptions.py
80 lines (47 loc) · 2 KB
/
exceptions.py
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
"""Handle all the custom exceptions raised."""
import sys
class QueuedSampleNotFoundException(Exception):
"""Custom exception handler for queued sample not found."""
def __init__(self, message: str) -> None:
Exception.__init__(self)
self.message = message
class SampleNotFoundException(Exception):
"""Custom exception triggered when sample not found."""
def __init__(self, message: str) -> None:
Exception.__init__(self)
self.message = message
class TestNotFoundException(Exception):
"""Custom exception handler for handling test not found."""
def __init__(self, message: str) -> None:
Exception.__init__(self)
self.message = message
class SecretKeyInstallationException(Exception):
"""Custom exception handler for handling failed installation of secret keys."""
def __init__(self) -> None:
Exception.__init__(self)
sys.exit(1)
class IncompleteConfigException(Exception):
"""Custom exception handler for handling missing configuration errors."""
pass
class MissingConfigError(Exception):
"""Custom exception handler for handling missing config.py file."""
pass
class FailedToSpawnDBSession(Exception):
"""Custom exception handler for handling failure of creating db session."""
pass
class EnumParsingException(Exception):
"""Custom exception handler for handling failed parsing of Enum from string."""
pass
class FailedToSendMail(Exception):
"""Custom exception handler for handling failure in sending mail."""
pass
class MissingPathToCCExtractor(Exception):
"""Custom exception handler for handling the missing of CCExtractor with update sample method."""
def __init__(self) -> None:
Exception.__init__(self)
sys.exit(1)
class CCExtractorEndedWithNonZero(Exception):
"""Custom exception handler for handling failure in producing new samples by CCExtractor."""
def __init__(self) -> None:
Exception.__init__(self)
sys.exit(1)