-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.py
More file actions
executable file
·68 lines (49 loc) · 1.75 KB
/
errors.py
File metadata and controls
executable file
·68 lines (49 loc) · 1.75 KB
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
'''
Custom Errors for the server and
Client to throw
'''
import re
class ServerError(Exception):
def __init__(self, error_msg):
error_msg = re.sub(r"[\n\s]+", ' ', error_msg)
super().__init__(error_msg)
class CommunicationTypeError(ServerError):
def __init__(self, error_msg=None):
if error_msg == None:
error_msg = "CommunicationTypeError"
super().__init__(error_msg)
class ClientParseError(ServerError):
def __init__(self, error_msg=None):
if error_msg == None:
error_msg = "ClientParseError"
super().__init__(error_msg)
class ClientCommandError(ServerError):
def __init__(self, error_msg=None):
if error_msg == None:
error_msg = "ClientCommandError"
super().__init__(error_msg)
class CommandGenerationError(ServerError):
def __init__(self, error_msg=None):
if error_msg == None:
error_msg = "ClientCommandError"
super().__init__(error_msg)
class PayloadGenerationError(ServerError):
def __init__(self, error_msg=None):
if error_msg == None:
error_msg = "PayloadGenerationError"
super().__init__(error_msg)
class EmptyPacketError(ServerError):
def __init__(self, error_msg=None):
if error_msg == None:
error_msg = "EmptyPacketError"
super().__init__(error_msg)
class GroupInstanceKeyError(ServerError):
def __init__(self, error_msg=None):
if error_msg == None:
error_msg = "EmptyPacketError"
super().__init__(error_msg)
class PostGenerationError(ServerError):
def __init__(self, error_msg=None):
if error_msg == None:
error_msg = "PostGenerationError"
super().__init__(error_msg)