-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patherr.py
118 lines (86 loc) · 1.91 KB
/
err.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# coding=utf-8
class OctpError(Exception):
"""
异常基类
"""
pass
#### for etcd ####
class OctpEtcdError(OctpError):
pass
class OctpEtcdConnectError(OctpEtcdError):
"""
Connect to etcd failed.
"""
pass
#### service相关 ####
class OctpServiceError(OctpError):
"""
服务相关错误
"""
pass
class OctpServiceNameError(OctpServiceError):
"""
没有在etcd中找到对应的service的目录,如想在/service/service_xxx目录下注册一个节点,但是service_xxx目录不存在
"""
pass
class OctpServiceNotFoundError(OctpServiceError):
"""
在etcd中找到了对应service的目录,但是该目录下没有可用的服务节点
"""
pass
class OctpServiceInfoError(OctpServiceError):
"""
Got some invalid service_info from etcd.
"""
pass
class OctpServiceInvalidState(OctpServiceError):
"""
非法的状态
"""
pass
class OctpServiceUnavailable(OctpServiceError):
"""
Current service is Unavailable. Should retry next service.
"""
pass
class OctpServiceAllFault(OctpServiceError):
"""
All service are fault. Should check service provider.
"""
#### About config ####
class OctpConfigError(OctpError):
"""
Base class for config error.
"""
pass
class OctpConfigNotFoundError(OctpConfigError):
"""
Can't find special config node in etcd
"""
pass
class OctpConfigInvalidState(OctpConfigError):
"""
"""
pass
#### 统计相关 ####
class OctpStatError(OctpError):
"""
统计模块相关的错误
"""
pass
class OctpStatLoseError(OctpStatError):
"""
和统计服务直接的连接丢失
"""
pass
#### 编程相关的错误 ####
class OctpProgramError(OctpError):
"""
编程相关的错误
"""
pass
class OctpParamError(OctpProgramError):
"""
传入参数错误
"""
pass