/
errors.go
240 lines (237 loc) · 14.6 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
// Code generated by errors-const v0.1.0 tool DO NOT EDIT.
package ably
// ably error codes
const (
ErrNoError = 10000
ErrBadRequest = 40000
ErrInvalidRequestBody = 40001
ErrInvalidParameterName = 40002
ErrInvalidParameterValue = 40003
ErrInvalidHeader = 40004
ErrInvalidCredential = 40005
ErrInvalidConnectionID = 40006
ErrInvalidMessageID = 40007
ErrInvalidContentLength = 40008
ErrMaximumMessageLengthExceeded = 40009
ErrInvalidChannelName = 40010
ErrStaleRingState = 40011
ErrInvalidClientID = 40012
ErrInvalidMessageDataOrEncoding = 40013
ErrResourceDisposed = 40014
ErrInvalidDeviceID = 40015
ErrBatchError = 40020
ErrInvalidPublishRequestUnspecified = 40030
ErrInvalidPublishRequestInvalidClientSpecifiedID = 40031
ErrUnauthorized = 40100
ErrInvalidCredentials = 40101
ErrIncompatibleCredentials = 40102
ErrInvalidUseOfBasicAuthOverNonTLSTransport = 40103
ErrTimestampNotCurrent = 40104
ErrNonceValueReplayed = 40105
ErrUnableToObtainCredentialsFromGivenParameters = 40106
ErrAccountDisabled = 40110
ErrAccountRestrictedConnectionLimitsExceeded = 40111
ErrAccountBlockedMessageLimitsExceeded = 40112
ErrAccountBlocked = 40113
ErrAccountRestrictedChannelLimitsExceeded = 40114
ErrApplicationDisabled = 40120
ErrKeyErrorUnspecified = 40130
ErrKeyRevoked = 40131
ErrKeyExpired = 40132
ErrKeyDisabled = 40133
ErrTokenErrorUnspecified = 40140
ErrTokenRevoked = 40141
ErrTokenExpired = 40142
ErrTokenUnrecognised = 40143
ErrInvalidJWTFormat = 40144
ErrInvalidTokenFormat = 40145
ErrConnectionBlockedLimitsExceeded = 40150
ErrOperationNotPermittedWithProvidedCapability = 40160
ErrErrorFromClientTokenCallback = 40170
ErrForbidden = 40300
ErrAccountDoesNotPermitTLSConnection = 40310
ErrOperationRequiresTLSConnection = 40311
ErrApplicationRequiresAuthentication = 40320
ErrNotFound = 40400
ErrMethodNotAllowed = 40500
ErrRateLimitExceededNonfatal = 42910
ErrMaxPerConnectionPublishRateLimitExceededNonfatal = 42911
ErrRateLimitExceededFatal = 42920
ErrMaxPerConnectionPublishRateLimitExceededFatal = 42921
ErrInternalError = 50000
ErrInternalChannelError = 50001
ErrInternalConnectionError = 50002
ErrTimeoutError = 50003
ErrRequestFailedDueToOverloadedInstance = 50004
ErrReactorOperationFailed = 70000
ErrReactorOperationFailedPostOperationFailed = 70001
ErrReactorOperationFailedPostOperationReturnedUnexpectedCode = 70002
ErrReactorOperationFailedMaximumNumberOfConcurrentInFlightRequestsExceeded = 70003
ErrExchangeErrorUnspecified = 71000
ErrForcedReAttachmentDueToPermissionsChange = 71001
ErrExchangePublisherErrorUnspecified = 71100
ErrNoSuchPublisher = 71101
ErrPublisherNotEnabledAsAnExchangePublisher = 71102
ErrExchangeProductErrorUnspecified = 71200
ErrNoSuchProduct = 71201
ErrProductDisabled = 71202
ErrNoSuchChannelInThisProduct = 71203
ErrExchangeSubscriptionErrorUnspecified = 71300
ErrSubscriptionDisabled = 71301
ErrRequesterHasNoSubscriptionToThisProduct = 71302
ErrConnectionFailed = 80000
ErrConnectionFailedNoCompatibleTransport = 80001
ErrConnectionSuspended = 80002
ErrDisconnected = 80003
ErrAlreadyConnected = 80004
ErrInvalidConnectionIDRemoteNotFound = 80005
ErrUnableToRecoverConnectionMessagesExpired = 80006
ErrUnableToRecoverConnectionMessageLimitExceeded = 80007
ErrUnableToRecoverConnectionConnectionExpired = 80008
ErrConnectionNotEstablishedNoTransportHandle = 80009
ErrInvalidOperationInvalidTransportHandle = 80010
ErrUnableToRecoverConnectionIncompatibleAuthParams = 80011
ErrUnableToRecoverConnectionInvalidOrUnspecifiedConnectionSerial = 80012
ErrProtocolError = 80013
ErrConnectionTimedOut = 80014
ErrIncompatibleConnectionParameters = 80015
ErrOperationOnSupersededTransport = 80016
ErrConnectionClosed = 80017
ErrInvalidConnectionIDInvalidFormat = 80018
ErrClientConfiguredAuthenticationProviderRequestFailed = 80019
ErrContinuityLossDueToMaximumSubscribeMessageRateExceeded = 80020
ErrClientRestrictionNotSatisfied = 80030
ErrChannelOperationFailed = 90000
ErrChannelOperationFailedInvalidChannelState = 90001
ErrChannelOperationFailedEpochExpiredOrNeverExisted = 90002
ErrUnableToRecoverChannelMessagesExpired = 90003
ErrUnableToRecoverChannelMessageLimitExceeded = 90004
ErrUnableToRecoverChannelNoMatchingEpoch = 90005
ErrUnableToRecoverChannelUnboundedRequest = 90006
ErrChannelOperationFailedNoResponseFromServer = 90007
ErrMaximumNumberOfChannelsPerConnectionExceeded = 90010
ErrUnableToEnterPresenceChannelNoClientID = 91000
ErrUnableToEnterPresenceChannelInvalidChannelState = 91001
ErrUnableToLeavePresenceChannelThatIsNotEntered = 91002
ErrUnableToEnterPresenceChannelMaximumMemberLimitExceeded = 91003
ErrUnableToAutomaticallyReEnterPresenceChannel = 91004
ErrPresenceStateIsOutOfSync = 91005
ErrMemberImplicitlyLeftPresenceChannelConnectionClosed = 91100
)
var errCodeText = map[int]string{
10000: "no error",
40000: "bad request",
40001: "invalid request body",
40002: "invalid parameter name",
40003: "invalid parameter value",
40004: "invalid header",
40005: "invalid credential",
40006: "invalid connection id",
40007: "invalid message id",
40008: "invalid content length",
40009: "maximum message length exceeded",
40010: "invalid channel name",
40011: "stale ring state",
40012: "invalid client id",
40013: "Invalid message data or encoding",
40014: "Resource disposed",
40015: "Invalid device id",
40020: "Batch error",
40030: "Invalid publish request (unspecified)",
40031: "Invalid publish request (invalid client-specified id)",
40100: "unauthorized",
40101: "invalid credentials",
40102: "incompatible credentials",
40103: "invalid use of Basic auth over non-TLS transport",
40104: "timestamp not current",
40105: "nonce value replayed",
40106: "Unable to obtain credentials from given parameters",
40110: "account disabled",
40111: "account restricted (connection limits exceeded)",
40112: "account blocked (message limits exceeded)",
40113: "account blocked",
40114: "account restricted (channel limits exceeded)",
40120: "application disabled",
40130: "key error (unspecified)",
40131: "key revoked",
40132: "key expired",
40133: "key disabled",
40140: "token error (unspecified)",
40141: "token revoked",
40142: "token expired",
40143: "token unrecognised",
40144: "invalid JWT format",
40145: "invalid token format",
40150: "connection blocked (limits exceeded)",
40160: "operation not permitted with provided capability",
40170: "error from client token callback",
40300: "forbidden",
40310: "account does not permit tls connection",
40311: "operation requires tls connection",
40320: "application requires authentication",
40400: "not found",
40500: "method not allowed",
42910: "rate limit exceeded (nonfatal): request rejected (unspecified)",
42911: "max per-connection publish rate limit exceeded (nonfatal): unable to publish message",
42920: "rate limit exceeded (fatal)",
42921: "max per-connection publish rate limit exceeded (fatal); closing connection",
50000: "internal error",
50001: "internal channel error",
50002: "internal connection error",
50003: "timeout error",
50004: "Request failed due to overloaded instance",
70000: "reactor operation failed",
70001: "reactor operation failed (post operation failed)",
70002: "reactor operation failed (post operation returned unexpected code)",
70003: "reactor operation failed (maximum number of concurrent in-flight requests exceeded)",
71000: "Exchange error (unspecified)",
71001: "Forced re-attachment due to permissions change",
71100: "Exchange publisher error (unspecified)",
71101: "No such publisher",
71102: "Publisher not enabled as an exchange publisher",
71200: "Exchange product error (unspecified)",
71201: "No such product",
71202: "Product disabled",
71203: "No such channel in this product",
71300: "Exchange subscription error (unspecified)",
71301: "Subscription disabled",
71302: "Requester has no subscription to this product",
80000: "connection failed",
80001: "connection failed (no compatible transport)",
80002: "connection suspended",
80003: "disconnected",
80004: "already connected",
80005: "invalid connection id (remote not found)",
80006: "unable to recover connection (messages expired)",
80007: "unable to recover connection (message limit exceeded)",
80008: "unable to recover connection (connection expired)",
80009: "connection not established (no transport handle)",
80010: "invalid operation (invalid transport handle)",
80011: "unable to recover connection (incompatible auth params)",
80012: "unable to recover connection (invalid or unspecified connection serial)",
80013: "protocol error",
80014: "connection timed out",
80015: "incompatible connection parameters",
80016: "operation on superseded transport",
80017: "connection closed",
80018: "invalid connection id (invalid format)",
80019: "client configured authentication provider request failed",
80020: "continuity loss due to maximum subscribe message rate exceeded",
80030: "client restriction not satisfied",
90000: "channel operation failed",
90001: "channel operation failed (invalid channel state)",
90002: "channel operation failed (epoch expired or never existed)",
90003: "unable to recover channel (messages expired)",
90004: "unable to recover channel (message limit exceeded)",
90005: "unable to recover channel (no matching epoch)",
90006: "unable to recover channel (unbounded request)",
90007: "channel operation failed (no response from server)",
90010: "maximum number of channels per connection exceeded",
91000: "unable to enter presence channel (no clientId)",
91001: "unable to enter presence channel (invalid channel state)",
91002: "unable to leave presence channel that is not entered",
91003: "unable to enter presence channel (maximum member limit exceeded)",
91004: "unable to automatically re-enter presence channel",
91005: "presence state is out of sync",
91100: "member implicitly left presence channel (connection closed)",
}