-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrors.py
71 lines (51 loc) · 1.46 KB
/
errors.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
ERROR_BANKER = 'banker error'
ERROR_SIGNER = 'signer error'
ERROR_BROADCASTER = 'broadcaster error'
ERROR_SCHEDULER = 'scheduler error'
ERROR_STAKINGER = 'stakinger error'
ERROR_DISTRIBUTION = 'distribution error'
class TxerError:
def __init__(self, errType, errMsg):
self.__errType = errType
self.__errMsg = errMsg
self.__fullErrMsg = ''
def Type(self):
return self.__errType
def Error(self):
if self.__fullErrMsg == '':
pass
return self.__fullErrMsg
def FullErrMsg(self):
str = 'Txer error '
if self.__errType != '':
str += '<'
str += self.__errType
str += "> "
str += self.__errMsg
self.__fullErrMsg = str
return
class IllegalError(Exception):
def __init__(self, msg):
self.msg = msg
def __str__(self):
return self.msg
class EmptyError(Exception):
def __init__(self, msg):
self.msg = 'dst is empty'
def __str__(self):
return self.msg
class AccountNotFoundError(Exception):
def __init__(self, name):
self.msg = 'account %s is not found' % (name)
def __str__(self):
return self.msg
class AccountParseError(Exception):
def __init__(self, msg):
self.msg = msg
def __str__(self):
return self.msg
class UnknownError(Exception):
def __init__(self):
self.msg = 'unknown error'
def __str__(self):
return self.msg