-
Notifications
You must be signed in to change notification settings - Fork 18
/
errors.go
163 lines (127 loc) · 3.27 KB
/
errors.go
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
package godis
//RedisError basic redis error
type RedisError struct {
Message string
}
func newRedisError(message string) *RedisError {
return &RedisError{Message: message}
}
func (e *RedisError) Error() string {
return e.Message
}
//RedirectError cluster operation redirect error
type RedirectError struct {
Message string
}
func newRedirectError(message string) *RedirectError {
return &RedirectError{Message: message}
}
func (e *RedirectError) Error() string {
return e.Message
}
//ClusterMaxAttemptsError cluster operation exceed max attempts errror
type ClusterMaxAttemptsError struct {
Message string
}
func newClusterMaxAttemptsError(message string) *ClusterMaxAttemptsError {
return &ClusterMaxAttemptsError{Message: message}
}
func (e *ClusterMaxAttemptsError) Error() string {
return e.Message
}
//NoReachableClusterNodeError have no reachable cluster node error
type NoReachableClusterNodeError struct {
Message string
}
func newNoReachableClusterNodeError(message string) *NoReachableClusterNodeError {
return &NoReachableClusterNodeError{Message: message}
}
func (e *NoReachableClusterNodeError) Error() string {
return e.Message
}
//MovedDataError cluster move data error
type MovedDataError struct {
Message string
Host string
Port int
Slot int
}
func newMovedDataError(message string, host string, port int, slot int) *MovedDataError {
return &MovedDataError{Message: message, Host: host, Port: port, Slot: slot}
}
func (e *MovedDataError) Error() string {
return e.Message
}
//AskDataError ask data error
type AskDataError struct {
Message string
Host string
Port int
Slot int
}
func newAskDataError(message string, host string, port int, slot int) *AskDataError {
return &AskDataError{Message: message, Host: host, Port: port, Slot: slot}
}
func (e *AskDataError) Error() string {
return e.Message
}
//ClusterError cluster basic error
type ClusterError struct {
Message string
}
func newClusterError(message string) *ClusterError {
return &ClusterError{Message: message}
}
func (e *ClusterError) Error() string {
return e.Message
}
//BusyError operation is busy error
type BusyError struct {
Message string
}
func newBusyError(message string) *BusyError {
return &BusyError{Message: message}
}
func (e *BusyError) Error() string {
return e.Message
}
//NoScriptError has no script error
type NoScriptError struct {
Message string
}
func newNoScriptError(message string) *NoScriptError {
return &NoScriptError{Message: message}
}
func (e *NoScriptError) Error() string {
return e.Message
}
//DataError data error
type DataError struct {
Message string
}
func newDataError(message string) *DataError {
return &DataError{Message: message}
}
func (e *DataError) Error() string {
return e.Message
}
//ConnectError redis connection error,such as io timeout
type ConnectError struct {
Message string
}
func newConnectError(message string) *ConnectError {
return &ConnectError{Message: message}
}
func (e *ConnectError) Error() string {
return e.Message
}
//ClusterOperationError cluster operation error
type ClusterOperationError struct {
Message string
}
func newClusterOperationError(message string) *ClusterOperationError {
return &ClusterOperationError{Message: message}
}
func (e *ClusterOperationError) Error() string {
return e.Message
}