-
Notifications
You must be signed in to change notification settings - Fork 3
/
bxdexceptions.py
58 lines (52 loc) · 1.45 KB
/
bxdexceptions.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
"""
Created: 08.06.2007, SG
Description: Module containing exceptions used by the different bxd modules
The exception hierarchy is not completely planned out yet
"""
class ParameterException(Exception):
"""
Created: 08.06.2007, SG
Description: Base ParameterException class to be raised when a method is called with incorrect parameter(s)
"""
def __init__(self, message):
"""
Basic constructor that sets a message for the message
"""
Exception.__init__(self)
self.message = message
class IncorrectSizeException(ParameterException):
"""
Created: 08.06.2007, SG
Description: Exception to raise when a method has received an incorrectly sized parameter (a list for example)
"""
def __init__(self, message):
"""
Basic overriden constructor, nothing special for this subclass
"""
ParameterException.__init__(self, message)
class MissingParameter(ParameterException):
"""
Exception to raise for example when a method is called with an important parameter set to None
@since: 26.07.2007
@author: SG
"""
def __init__(self, message):
"""
Basic overriden constructor, nothing special for this subclass
@since: 26.07.2007
@author: SG
"""
ParameterException.__init__(self, message)
class AbstractMethodCalled(Exception):
"""
To be raised when an abstract method is called
@since: 27.07.2007
@author: SG
"""
def __init__(self, *args):
"""
Basic constructor
@since: 27.07.2007
@author: SG
"""
Exception.__init__(self, *args)