-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
errors.go
267 lines (235 loc) · 11.4 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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package sqs
import (
"github.com/aws/aws-sdk-go/private/protocol"
)
const (
// ErrCodeBatchEntryIdsNotDistinct for service response error code
// "AWS.SimpleQueueService.BatchEntryIdsNotDistinct".
//
// Two or more batch entries in the request have the same Id.
ErrCodeBatchEntryIdsNotDistinct = "AWS.SimpleQueueService.BatchEntryIdsNotDistinct"
// ErrCodeBatchRequestTooLong for service response error code
// "AWS.SimpleQueueService.BatchRequestTooLong".
//
// The length of all the messages put together is more than the limit.
ErrCodeBatchRequestTooLong = "AWS.SimpleQueueService.BatchRequestTooLong"
// ErrCodeEmptyBatchRequest for service response error code
// "AWS.SimpleQueueService.EmptyBatchRequest".
//
// The batch request doesn't contain any entries.
ErrCodeEmptyBatchRequest = "AWS.SimpleQueueService.EmptyBatchRequest"
// ErrCodeInvalidAddress for service response error code
// "InvalidAddress".
//
// The accountId is invalid.
ErrCodeInvalidAddress = "InvalidAddress"
// ErrCodeInvalidAttributeName for service response error code
// "InvalidAttributeName".
//
// The specified attribute doesn't exist.
ErrCodeInvalidAttributeName = "InvalidAttributeName"
// ErrCodeInvalidAttributeValue for service response error code
// "InvalidAttributeValue".
//
// A queue attribute value is invalid.
ErrCodeInvalidAttributeValue = "InvalidAttributeValue"
// ErrCodeInvalidBatchEntryId for service response error code
// "AWS.SimpleQueueService.InvalidBatchEntryId".
//
// The Id of a batch entry in a batch request doesn't abide by the specification.
ErrCodeInvalidBatchEntryId = "AWS.SimpleQueueService.InvalidBatchEntryId"
// ErrCodeInvalidIdFormat for service response error code
// "InvalidIdFormat".
//
// The specified receipt handle isn't valid for the current version.
ErrCodeInvalidIdFormat = "InvalidIdFormat"
// ErrCodeInvalidMessageContents for service response error code
// "InvalidMessageContents".
//
// The message contains characters outside the allowed set.
ErrCodeInvalidMessageContents = "InvalidMessageContents"
// ErrCodeInvalidSecurity for service response error code
// "InvalidSecurity".
//
// When the request to a queue is not HTTPS and SigV4.
ErrCodeInvalidSecurity = "InvalidSecurity"
// ErrCodeKmsAccessDenied for service response error code
// "KmsAccessDenied".
//
// The caller doesn't have the required KMS access.
ErrCodeKmsAccessDenied = "KmsAccessDenied"
// ErrCodeKmsDisabled for service response error code
// "KmsDisabled".
//
// The request was denied due to request throttling.
ErrCodeKmsDisabled = "KmsDisabled"
// ErrCodeKmsInvalidKeyUsage for service response error code
// "KmsInvalidKeyUsage".
//
// The request was rejected for one of the following reasons:
//
// * The KeyUsage value of the KMS key is incompatible with the API operation.
//
// * The encryption algorithm or signing algorithm specified for the operation
// is incompatible with the type of key material in the KMS key (KeySpec).
ErrCodeKmsInvalidKeyUsage = "KmsInvalidKeyUsage"
// ErrCodeKmsInvalidState for service response error code
// "KmsInvalidState".
//
// The request was rejected because the state of the specified resource is not
// valid for this request.
ErrCodeKmsInvalidState = "KmsInvalidState"
// ErrCodeKmsNotFound for service response error code
// "KmsNotFound".
//
// The request was rejected because the specified entity or resource could not
// be found.
ErrCodeKmsNotFound = "KmsNotFound"
// ErrCodeKmsOptInRequired for service response error code
// "KmsOptInRequired".
//
// The request was rejected because the specified key policy isn't syntactically
// or semantically correct.
ErrCodeKmsOptInRequired = "KmsOptInRequired"
// ErrCodeKmsThrottled for service response error code
// "KmsThrottled".
//
// Amazon Web Services KMS throttles requests for the following conditions.
ErrCodeKmsThrottled = "KmsThrottled"
// ErrCodeMessageNotInflight for service response error code
// "AWS.SimpleQueueService.MessageNotInflight".
//
// The specified message isn't in flight.
ErrCodeMessageNotInflight = "AWS.SimpleQueueService.MessageNotInflight"
// ErrCodeOverLimit for service response error code
// "OverLimit".
//
// The specified action violates a limit. For example, ReceiveMessage returns
// this error if the maximum number of in flight messages is reached and AddPermission
// returns this error if the maximum number of permissions for the queue is
// reached.
ErrCodeOverLimit = "OverLimit"
// ErrCodePurgeQueueInProgress for service response error code
// "AWS.SimpleQueueService.PurgeQueueInProgress".
//
// Indicates that the specified queue previously received a PurgeQueue request
// within the last 60 seconds (the time it can take to delete the messages in
// the queue).
ErrCodePurgeQueueInProgress = "AWS.SimpleQueueService.PurgeQueueInProgress"
// ErrCodeQueueDeletedRecently for service response error code
// "AWS.SimpleQueueService.QueueDeletedRecently".
//
// You must wait 60 seconds after deleting a queue before you can create another
// queue with the same name.
ErrCodeQueueDeletedRecently = "AWS.SimpleQueueService.QueueDeletedRecently"
// ErrCodeQueueDoesNotExist for service response error code
// "AWS.SimpleQueueService.NonExistentQueue".
//
// The specified queue doesn't exist.
ErrCodeQueueDoesNotExist = "AWS.SimpleQueueService.NonExistentQueue"
// ErrCodeQueueNameExists for service response error code
// "QueueAlreadyExists".
//
// A queue with this name already exists. Amazon SQS returns this error only
// if the request includes attributes whose values differ from those of the
// existing queue.
ErrCodeQueueNameExists = "QueueAlreadyExists"
// ErrCodeReceiptHandleIsInvalid for service response error code
// "ReceiptHandleIsInvalid".
//
// The specified receipt handle isn't valid.
ErrCodeReceiptHandleIsInvalid = "ReceiptHandleIsInvalid"
// ErrCodeRequestThrottled for service response error code
// "RequestThrottled".
//
// The request was denied due to request throttling.
//
// * The rate of requests per second exceeds the Amazon Web Services KMS
// request quota for an account and Region.
//
// * A burst or sustained high rate of requests to change the state of the
// same KMS key. This condition is often known as a "hot key."
//
// * Requests for operations on KMS keys in a Amazon Web Services CloudHSM
// key store might be throttled at a lower-than-expected rate when the Amazon
// Web Services CloudHSM cluster associated with the Amazon Web Services
// CloudHSM key store is processing numerous commands, including those unrelated
// to the Amazon Web Services CloudHSM key store.
ErrCodeRequestThrottled = "RequestThrottled"
// ErrCodeResourceNotFoundException for service response error code
// "ResourceNotFoundException".
//
// One or more specified resources don't exist.
ErrCodeResourceNotFoundException = "ResourceNotFoundException"
// ErrCodeTooManyEntriesInBatchRequest for service response error code
// "AWS.SimpleQueueService.TooManyEntriesInBatchRequest".
//
// The batch request contains more entries than permissible.
ErrCodeTooManyEntriesInBatchRequest = "AWS.SimpleQueueService.TooManyEntriesInBatchRequest"
// ErrCodeUnsupportedOperation for service response error code
// "AWS.SimpleQueueService.UnsupportedOperation".
//
// Error code 400. Unsupported operation.
ErrCodeUnsupportedOperation = "AWS.SimpleQueueService.UnsupportedOperation"
)
var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{
"BatchEntryIdsNotDistinct": newErrorBatchEntryIdsNotDistinct,
"BatchRequestTooLong": newErrorBatchRequestTooLong,
"EmptyBatchRequest": newErrorEmptyBatchRequest,
"InvalidAddress": newErrorInvalidAddress,
"InvalidAttributeName": newErrorInvalidAttributeName,
"InvalidAttributeValue": newErrorInvalidAttributeValue,
"InvalidBatchEntryId": newErrorInvalidBatchEntryId,
"InvalidIdFormat": newErrorInvalidIdFormat,
"InvalidMessageContents": newErrorInvalidMessageContents,
"InvalidSecurity": newErrorInvalidSecurity,
"KmsAccessDenied": newErrorKmsAccessDenied,
"KmsDisabled": newErrorKmsDisabled,
"KmsInvalidKeyUsage": newErrorKmsInvalidKeyUsage,
"KmsInvalidState": newErrorKmsInvalidState,
"KmsNotFound": newErrorKmsNotFound,
"KmsOptInRequired": newErrorKmsOptInRequired,
"KmsThrottled": newErrorKmsThrottled,
"MessageNotInflight": newErrorMessageNotInflight,
"OverLimit": newErrorOverLimit,
"PurgeQueueInProgress": newErrorPurgeQueueInProgress,
"QueueDeletedRecently": newErrorQueueDeletedRecently,
"QueueDoesNotExist": newErrorQueueDoesNotExist,
"QueueNameExists": newErrorQueueNameExists,
"ReceiptHandleIsInvalid": newErrorReceiptHandleIsInvalid,
"RequestThrottled": newErrorRequestThrottled,
"ResourceNotFoundException": newErrorResourceNotFoundException,
"TooManyEntriesInBatchRequest": newErrorTooManyEntriesInBatchRequest,
"UnsupportedOperation": newErrorUnsupportedOperation,
}
var queryExceptionFromCode = map[string]func(protocol.ResponseMetadata, string) error{
"BatchEntryIdsNotDistinct": newQueryCompatibleErrorBatchEntryIdsNotDistinct,
"BatchRequestTooLong": newQueryCompatibleErrorBatchRequestTooLong,
"EmptyBatchRequest": newQueryCompatibleErrorEmptyBatchRequest,
"InvalidAddress": newQueryCompatibleErrorInvalidAddress,
"InvalidAttributeName": newQueryCompatibleErrorInvalidAttributeName,
"InvalidAttributeValue": newQueryCompatibleErrorInvalidAttributeValue,
"InvalidBatchEntryId": newQueryCompatibleErrorInvalidBatchEntryId,
"InvalidIdFormat": newQueryCompatibleErrorInvalidIdFormat,
"InvalidMessageContents": newQueryCompatibleErrorInvalidMessageContents,
"InvalidSecurity": newQueryCompatibleErrorInvalidSecurity,
"KmsAccessDenied": newQueryCompatibleErrorKmsAccessDenied,
"KmsDisabled": newQueryCompatibleErrorKmsDisabled,
"KmsInvalidKeyUsage": newQueryCompatibleErrorKmsInvalidKeyUsage,
"KmsInvalidState": newQueryCompatibleErrorKmsInvalidState,
"KmsNotFound": newQueryCompatibleErrorKmsNotFound,
"KmsOptInRequired": newQueryCompatibleErrorKmsOptInRequired,
"KmsThrottled": newQueryCompatibleErrorKmsThrottled,
"MessageNotInflight": newQueryCompatibleErrorMessageNotInflight,
"OverLimit": newQueryCompatibleErrorOverLimit,
"PurgeQueueInProgress": newQueryCompatibleErrorPurgeQueueInProgress,
"QueueDeletedRecently": newQueryCompatibleErrorQueueDeletedRecently,
"QueueDoesNotExist": newQueryCompatibleErrorQueueDoesNotExist,
"QueueNameExists": newQueryCompatibleErrorQueueNameExists,
"ReceiptHandleIsInvalid": newQueryCompatibleErrorReceiptHandleIsInvalid,
"RequestThrottled": newQueryCompatibleErrorRequestThrottled,
"ResourceNotFoundException": newQueryCompatibleErrorResourceNotFoundException,
"TooManyEntriesInBatchRequest": newQueryCompatibleErrorTooManyEntriesInBatchRequest,
"UnsupportedOperation": newQueryCompatibleErrorUnsupportedOperation,
}