-
Notifications
You must be signed in to change notification settings - Fork 4
/
Exceptions.py
53 lines (33 loc) · 1.11 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
"""
Error class for unsupported or missing parameters
"""
class ParameterError(Exception):
def __init__(self, message, logger=None):
super(ParameterError, self).__init__(message)
if not logger is None:
logger.error(message)
"""
Raised when the model is used before setting the initial state
"""
class StateNotSetError(Exception):
def __init__(self, logger=None):
super(StateNotSetError, self).__init__("State has not been set")
if not logger is None:
logger.error("State has not been set")
"""
Raised for errors that are caused by internal bugs.
These will never happen.
"""
class InternalError(Exception):
def __init__(self, message, logger=None):
super(InternalError, self).__init__(message)
if not logger is None:
logger.error(message)
"""
Error class for errors in the configuration file
"""
class ConfigurationError(Exception):
def __init__(self, message, logger=None):
super(ConfigurationError, self).__init__(message)
if not logger is None:
logger.error(message)