Wsgi_15Watt.Exceptions

The exceptions that can be thrown by the application.

If you like to create your own exception, please derive them from Base.

 1"""
 2    The exceptions that can be thrown by the application.
 3
 4    If you like to create your own exception, please derive them from Base.
 5"""
 6
 7
 8class Base(Exception):
 9    """
10    Base class of all Wsgi exceptions.
11    """
12    def __init__(self, returnCode: int = 500, returnMsg: str = 'Internal server _error'):
13        self.__returnCode = returnCode
14        self.__returnMsg = returnMsg
15
16    @property
17    def returnCode(self) -> int:
18        return self.__returnCode
19
20    @property
21    def returnMsg(self) -> str:
22        return self.__returnMsg
23
24
25class ProtocolException(Base):
26    def __init__(self, returnCode: int = 500, returnMsg: str = 'Protocol exception'):
27        self.__returnCode = returnCode
28        self.__returnMsg = returnMsg
29
30
31class ParamNotFound(Base):
32    def __init__(self, returnCode: int = 400, returnMsg: str = 'Parameter not found'):
33        self.__returnCode = returnCode
34        self.__returnMsg = returnMsg
35
36
37class ValueNotFound(Base):
38    def __init__(self, returnCode: int = 500, returnMsg: str = 'Value not found'):
39        self.__returnCode = returnCode
40        self.__returnMsg = returnMsg
41
42
43class FileNotFound(Base):
44    def __init__(self, returnCode: int = 404, returnMsg: str = 'File not found'):
45        self.__returnCode = returnCode
46        self.__returnMsg = returnMsg
47
48
49class NotAllowedHttpMethod(Base):
50    def __init__(self, returnCode: int = 405, returnMsg: str = 'Not allowed HTTP method'):
51        self.__returnCode = returnCode
52        self.__returnMsg = returnMsg
53
54
55class NotAllowedHttpResponseCode(Base):
56    def __init__(self, returnCode: int = 500, returnMsg: str = 'Not allowed HTTP response code'):
57        self.__returnCode = returnCode
58        self.__returnMsg = returnMsg
59
60
61class InvalidData(Base):
62    def __init__(self, returnCode: int = 500, returnMsg: str = 'Invalid data'):
63        self.__returnCode = returnCode
64        self.__returnMsg = returnMsg
65
66
67class NotUnique(Base):
68    def __init__(self, returnCode: int = 500, returnMsg: str = 'Not unique'):
69        self.__returnCode = returnCode
70        self.__returnMsg = returnMsg
71
72
73class Unauthorized(Base):
74    def __init__(self, returnCode: int = 401, returnMsg: str = 'Unauthorized'):
75        self.__returnCode = returnCode
76        self.__returnMsg = returnMsg
class Base(builtins.Exception):
 9class Base(Exception):
10    """
11    Base class of all Wsgi exceptions.
12    """
13    def __init__(self, returnCode: int = 500, returnMsg: str = 'Internal server _error'):
14        self.__returnCode = returnCode
15        self.__returnMsg = returnMsg
16
17    @property
18    def returnCode(self) -> int:
19        return self.__returnCode
20
21    @property
22    def returnMsg(self) -> str:
23        return self.__returnMsg

Base class of all Wsgi exceptions.

Base(returnCode: int = 500, returnMsg: str = 'Internal server _error')
13    def __init__(self, returnCode: int = 500, returnMsg: str = 'Internal server _error'):
14        self.__returnCode = returnCode
15        self.__returnMsg = returnMsg
returnCode: int
17    @property
18    def returnCode(self) -> int:
19        return self.__returnCode
returnMsg: str
21    @property
22    def returnMsg(self) -> str:
23        return self.__returnMsg
class ProtocolException(Base):
26class ProtocolException(Base):
27    def __init__(self, returnCode: int = 500, returnMsg: str = 'Protocol exception'):
28        self.__returnCode = returnCode
29        self.__returnMsg = returnMsg

Base class of all Wsgi exceptions.

ProtocolException(returnCode: int = 500, returnMsg: str = 'Protocol exception')
27    def __init__(self, returnCode: int = 500, returnMsg: str = 'Protocol exception'):
28        self.__returnCode = returnCode
29        self.__returnMsg = returnMsg
Inherited Members
Base
returnCode
returnMsg
class ParamNotFound(Base):
32class ParamNotFound(Base):
33    def __init__(self, returnCode: int = 400, returnMsg: str = 'Parameter not found'):
34        self.__returnCode = returnCode
35        self.__returnMsg = returnMsg

Base class of all Wsgi exceptions.

ParamNotFound(returnCode: int = 400, returnMsg: str = 'Parameter not found')
33    def __init__(self, returnCode: int = 400, returnMsg: str = 'Parameter not found'):
34        self.__returnCode = returnCode
35        self.__returnMsg = returnMsg
Inherited Members
Base
returnCode
returnMsg
class ValueNotFound(Base):
38class ValueNotFound(Base):
39    def __init__(self, returnCode: int = 500, returnMsg: str = 'Value not found'):
40        self.__returnCode = returnCode
41        self.__returnMsg = returnMsg

Base class of all Wsgi exceptions.

ValueNotFound(returnCode: int = 500, returnMsg: str = 'Value not found')
39    def __init__(self, returnCode: int = 500, returnMsg: str = 'Value not found'):
40        self.__returnCode = returnCode
41        self.__returnMsg = returnMsg
Inherited Members
Base
returnCode
returnMsg
class FileNotFound(Base):
44class FileNotFound(Base):
45    def __init__(self, returnCode: int = 404, returnMsg: str = 'File not found'):
46        self.__returnCode = returnCode
47        self.__returnMsg = returnMsg

Base class of all Wsgi exceptions.

FileNotFound(returnCode: int = 404, returnMsg: str = 'File not found')
45    def __init__(self, returnCode: int = 404, returnMsg: str = 'File not found'):
46        self.__returnCode = returnCode
47        self.__returnMsg = returnMsg
Inherited Members
Base
returnCode
returnMsg
class NotAllowedHttpMethod(Base):
50class NotAllowedHttpMethod(Base):
51    def __init__(self, returnCode: int = 405, returnMsg: str = 'Not allowed HTTP method'):
52        self.__returnCode = returnCode
53        self.__returnMsg = returnMsg

Base class of all Wsgi exceptions.

NotAllowedHttpMethod(returnCode: int = 405, returnMsg: str = 'Not allowed HTTP method')
51    def __init__(self, returnCode: int = 405, returnMsg: str = 'Not allowed HTTP method'):
52        self.__returnCode = returnCode
53        self.__returnMsg = returnMsg
Inherited Members
Base
returnCode
returnMsg
class NotAllowedHttpResponseCode(Base):
56class NotAllowedHttpResponseCode(Base):
57    def __init__(self, returnCode: int = 500, returnMsg: str = 'Not allowed HTTP response code'):
58        self.__returnCode = returnCode
59        self.__returnMsg = returnMsg

Base class of all Wsgi exceptions.

NotAllowedHttpResponseCode( returnCode: int = 500, returnMsg: str = 'Not allowed HTTP response code')
57    def __init__(self, returnCode: int = 500, returnMsg: str = 'Not allowed HTTP response code'):
58        self.__returnCode = returnCode
59        self.__returnMsg = returnMsg
Inherited Members
Base
returnCode
returnMsg
class InvalidData(Base):
62class InvalidData(Base):
63    def __init__(self, returnCode: int = 500, returnMsg: str = 'Invalid data'):
64        self.__returnCode = returnCode
65        self.__returnMsg = returnMsg

Base class of all Wsgi exceptions.

InvalidData(returnCode: int = 500, returnMsg: str = 'Invalid data')
63    def __init__(self, returnCode: int = 500, returnMsg: str = 'Invalid data'):
64        self.__returnCode = returnCode
65        self.__returnMsg = returnMsg
Inherited Members
Base
returnCode
returnMsg
class NotUnique(Base):
68class NotUnique(Base):
69    def __init__(self, returnCode: int = 500, returnMsg: str = 'Not unique'):
70        self.__returnCode = returnCode
71        self.__returnMsg = returnMsg

Base class of all Wsgi exceptions.

NotUnique(returnCode: int = 500, returnMsg: str = 'Not unique')
69    def __init__(self, returnCode: int = 500, returnMsg: str = 'Not unique'):
70        self.__returnCode = returnCode
71        self.__returnMsg = returnMsg
Inherited Members
Base
returnCode
returnMsg
class Unauthorized(Base):
74class Unauthorized(Base):
75    def __init__(self, returnCode: int = 401, returnMsg: str = 'Unauthorized'):
76        self.__returnCode = returnCode
77        self.__returnMsg = returnMsg

Base class of all Wsgi exceptions.

Unauthorized(returnCode: int = 401, returnMsg: str = 'Unauthorized')
75    def __init__(self, returnCode: int = 401, returnMsg: str = 'Unauthorized'):
76        self.__returnCode = returnCode
77        self.__returnMsg = returnMsg
Inherited Members
Base
returnCode
returnMsg