-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
errors.go
327 lines (294 loc) · 15.5 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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package dynamodb
import (
"github.com/aws/aws-sdk-go/private/protocol"
)
const (
// ErrCodeBackupInUseException for service response error code
// "BackupInUseException".
//
// There is another ongoing conflicting backup control plane operation on the
// table. The backup is either being created, deleted or restored to a table.
ErrCodeBackupInUseException = "BackupInUseException"
// ErrCodeBackupNotFoundException for service response error code
// "BackupNotFoundException".
//
// Backup not found for the given BackupARN.
ErrCodeBackupNotFoundException = "BackupNotFoundException"
// ErrCodeConditionalCheckFailedException for service response error code
// "ConditionalCheckFailedException".
//
// A condition specified in the operation could not be evaluated.
ErrCodeConditionalCheckFailedException = "ConditionalCheckFailedException"
// ErrCodeContinuousBackupsUnavailableException for service response error code
// "ContinuousBackupsUnavailableException".
//
// Backups have not yet been enabled for this table.
ErrCodeContinuousBackupsUnavailableException = "ContinuousBackupsUnavailableException"
// ErrCodeDuplicateItemException for service response error code
// "DuplicateItemException".
//
// There was an attempt to insert an item with the same primary key as an item
// that already exists in the DynamoDB table.
ErrCodeDuplicateItemException = "DuplicateItemException"
// ErrCodeExportConflictException for service response error code
// "ExportConflictException".
//
// There was a conflict when writing to the specified S3 bucket.
ErrCodeExportConflictException = "ExportConflictException"
// ErrCodeExportNotFoundException for service response error code
// "ExportNotFoundException".
//
// The specified export was not found.
ErrCodeExportNotFoundException = "ExportNotFoundException"
// ErrCodeGlobalTableAlreadyExistsException for service response error code
// "GlobalTableAlreadyExistsException".
//
// The specified global table already exists.
ErrCodeGlobalTableAlreadyExistsException = "GlobalTableAlreadyExistsException"
// ErrCodeGlobalTableNotFoundException for service response error code
// "GlobalTableNotFoundException".
//
// The specified global table does not exist.
ErrCodeGlobalTableNotFoundException = "GlobalTableNotFoundException"
// ErrCodeIdempotentParameterMismatchException for service response error code
// "IdempotentParameterMismatchException".
//
// DynamoDB rejected the request because you retried a request with a different
// payload but with an idempotent token that was already used.
ErrCodeIdempotentParameterMismatchException = "IdempotentParameterMismatchException"
// ErrCodeIndexNotFoundException for service response error code
// "IndexNotFoundException".
//
// The operation tried to access a nonexistent index.
ErrCodeIndexNotFoundException = "IndexNotFoundException"
// ErrCodeInternalServerError for service response error code
// "InternalServerError".
//
// An error occurred on the server side.
ErrCodeInternalServerError = "InternalServerError"
// ErrCodeInvalidExportTimeException for service response error code
// "InvalidExportTimeException".
//
// The specified ExportTime is outside of the point in time recovery window.
ErrCodeInvalidExportTimeException = "InvalidExportTimeException"
// ErrCodeInvalidRestoreTimeException for service response error code
// "InvalidRestoreTimeException".
//
// An invalid restore time was specified. RestoreDateTime must be between EarliestRestorableDateTime
// and LatestRestorableDateTime.
ErrCodeInvalidRestoreTimeException = "InvalidRestoreTimeException"
// ErrCodeItemCollectionSizeLimitExceededException for service response error code
// "ItemCollectionSizeLimitExceededException".
//
// An item collection is too large. This exception is only returned for tables
// that have one or more local secondary indexes.
ErrCodeItemCollectionSizeLimitExceededException = "ItemCollectionSizeLimitExceededException"
// ErrCodeLimitExceededException for service response error code
// "LimitExceededException".
//
// There is no limit to the number of daily on-demand backups that can be taken.
//
// Up to 50 simultaneous table operations are allowed per account. These operations
// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup,
// and RestoreTableToPointInTime.
//
// The only exception is when you are creating a table with one or more secondary
// indexes. You can have up to 25 such requests running at a time; however,
// if the table or index specifications are complex, DynamoDB might temporarily
// reduce the number of concurrent operations.
//
// There is a soft account quota of 256 tables.
ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodePointInTimeRecoveryUnavailableException for service response error code
// "PointInTimeRecoveryUnavailableException".
//
// Point in time recovery has not yet been enabled for this source table.
ErrCodePointInTimeRecoveryUnavailableException = "PointInTimeRecoveryUnavailableException"
// ErrCodeProvisionedThroughputExceededException for service response error code
// "ProvisionedThroughputExceededException".
//
// Your request rate is too high. The AWS SDKs for DynamoDB automatically retry
// requests that receive this exception. Your request is eventually successful,
// unless your retry queue is too large to finish. Reduce the frequency of requests
// and use exponential backoff. For more information, go to Error Retries and
// Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff)
// in the Amazon DynamoDB Developer Guide.
ErrCodeProvisionedThroughputExceededException = "ProvisionedThroughputExceededException"
// ErrCodeReplicaAlreadyExistsException for service response error code
// "ReplicaAlreadyExistsException".
//
// The specified replica is already part of the global table.
ErrCodeReplicaAlreadyExistsException = "ReplicaAlreadyExistsException"
// ErrCodeReplicaNotFoundException for service response error code
// "ReplicaNotFoundException".
//
// The specified replica is no longer part of the global table.
ErrCodeReplicaNotFoundException = "ReplicaNotFoundException"
// ErrCodeRequestLimitExceeded for service response error code
// "RequestLimitExceeded".
//
// Throughput exceeds the current throughput quota for your account. Please
// contact AWS Support at AWS Support (https://aws.amazon.com/support) to request
// a quota increase.
ErrCodeRequestLimitExceeded = "RequestLimitExceeded"
// ErrCodeResourceInUseException for service response error code
// "ResourceInUseException".
//
// The operation conflicts with the resource's availability. For example, you
// attempted to recreate an existing table, or tried to delete a table currently
// in the CREATING state.
ErrCodeResourceInUseException = "ResourceInUseException"
// ErrCodeResourceNotFoundException for service response error code
// "ResourceNotFoundException".
//
// The operation tried to access a nonexistent table or index. The resource
// might not be specified correctly, or its status might not be ACTIVE.
ErrCodeResourceNotFoundException = "ResourceNotFoundException"
// ErrCodeTableAlreadyExistsException for service response error code
// "TableAlreadyExistsException".
//
// A target table with the specified name already exists.
ErrCodeTableAlreadyExistsException = "TableAlreadyExistsException"
// ErrCodeTableInUseException for service response error code
// "TableInUseException".
//
// A target table with the specified name is either being created or deleted.
ErrCodeTableInUseException = "TableInUseException"
// ErrCodeTableNotFoundException for service response error code
// "TableNotFoundException".
//
// A source table with the name TableName does not currently exist within the
// subscriber's account.
ErrCodeTableNotFoundException = "TableNotFoundException"
// ErrCodeTransactionCanceledException for service response error code
// "TransactionCanceledException".
//
// The entire transaction request was canceled.
//
// DynamoDB cancels a TransactWriteItems request under the following circumstances:
//
// * A condition in one of the condition expressions is not met.
//
// * A table in the TransactWriteItems request is in a different account
// or region.
//
// * More than one action in the TransactWriteItems operation targets the
// same item.
//
// * There is insufficient provisioned capacity for the transaction to be
// completed.
//
// * An item size becomes too large (larger than 400 KB), or a local secondary
// index (LSI) becomes too large, or a similar validation error occurs because
// of changes made by the transaction.
//
// * There is a user error, such as an invalid data format.
//
// DynamoDB cancels a TransactGetItems request under the following circumstances:
//
// * There is an ongoing TransactGetItems operation that conflicts with a
// concurrent PutItem, UpdateItem, DeleteItem or TransactWriteItems request.
// In this case the TransactGetItems operation fails with a TransactionCanceledException.
//
// * A table in the TransactGetItems request is in a different account or
// region.
//
// * There is insufficient provisioned capacity for the transaction to be
// completed.
//
// * There is a user error, such as an invalid data format.
//
// If using Java, DynamoDB lists the cancellation reasons on the CancellationReasons
// property. This property is not set for other languages. Transaction cancellation
// reasons are ordered in the order of requested items, if an item has no error
// it will have NONE code and Null message.
//
// Cancellation reason codes and possible error messages:
//
// * No Errors: Code: NONE Message: null
//
// * Conditional Check Failed: Code: ConditionalCheckFailed Message: The
// conditional request failed.
//
// * Item Collection Size Limit Exceeded: Code: ItemCollectionSizeLimitExceeded
// Message: Collection size exceeded.
//
// * Transaction Conflict: Code: TransactionConflict Message: Transaction
// is ongoing for the item.
//
// * Provisioned Throughput Exceeded: Code: ProvisionedThroughputExceeded
// Messages: The level of configured provisioned throughput for the table
// was exceeded. Consider increasing your provisioning level with the UpdateTable
// API. This Message is received when provisioned throughput is exceeded
// is on a provisioned DynamoDB table. The level of configured provisioned
// throughput for one or more global secondary indexes of the table was exceeded.
// Consider increasing your provisioning level for the under-provisioned
// global secondary indexes with the UpdateTable API. This message is returned
// when provisioned throughput is exceeded is on a provisioned GSI.
//
// * Throttling Error: Code: ThrottlingError Messages: Throughput exceeds
// the current capacity of your table or index. DynamoDB is automatically
// scaling your table or index so please try again shortly. If exceptions
// persist, check if you have a hot key: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html.
// This message is returned when writes get throttled on an On-Demand table
// as DynamoDB is automatically scaling the table. Throughput exceeds the
// current capacity for one or more global secondary indexes. DynamoDB is
// automatically scaling your index so please try again shortly. This message
// is returned when when writes get throttled on an On-Demand GSI as DynamoDB
// is automatically scaling the GSI.
//
// * Validation Error: Code: ValidationError Messages: One or more parameter
// values were invalid. The update expression attempted to update the secondary
// index key beyond allowed size limits. The update expression attempted
// to update the secondary index key to unsupported type. An operand in the
// update expression has an incorrect data type. Item size to update has
// exceeded the maximum allowed size. Number overflow. Attempting to store
// a number with magnitude larger than supported range. Type mismatch for
// attribute to update. Nesting Levels have exceeded supported limits. The
// document path provided in the update expression is invalid for update.
// The provided expression refers to an attribute that does not exist in
// the item.
ErrCodeTransactionCanceledException = "TransactionCanceledException"
// ErrCodeTransactionConflictException for service response error code
// "TransactionConflictException".
//
// Operation was rejected because there is an ongoing transaction for the item.
ErrCodeTransactionConflictException = "TransactionConflictException"
// ErrCodeTransactionInProgressException for service response error code
// "TransactionInProgressException".
//
// The transaction with the given request token is already in progress.
ErrCodeTransactionInProgressException = "TransactionInProgressException"
)
var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{
"BackupInUseException": newErrorBackupInUseException,
"BackupNotFoundException": newErrorBackupNotFoundException,
"ConditionalCheckFailedException": newErrorConditionalCheckFailedException,
"ContinuousBackupsUnavailableException": newErrorContinuousBackupsUnavailableException,
"DuplicateItemException": newErrorDuplicateItemException,
"ExportConflictException": newErrorExportConflictException,
"ExportNotFoundException": newErrorExportNotFoundException,
"GlobalTableAlreadyExistsException": newErrorGlobalTableAlreadyExistsException,
"GlobalTableNotFoundException": newErrorGlobalTableNotFoundException,
"IdempotentParameterMismatchException": newErrorIdempotentParameterMismatchException,
"IndexNotFoundException": newErrorIndexNotFoundException,
"InternalServerError": newErrorInternalServerError,
"InvalidExportTimeException": newErrorInvalidExportTimeException,
"InvalidRestoreTimeException": newErrorInvalidRestoreTimeException,
"ItemCollectionSizeLimitExceededException": newErrorItemCollectionSizeLimitExceededException,
"LimitExceededException": newErrorLimitExceededException,
"PointInTimeRecoveryUnavailableException": newErrorPointInTimeRecoveryUnavailableException,
"ProvisionedThroughputExceededException": newErrorProvisionedThroughputExceededException,
"ReplicaAlreadyExistsException": newErrorReplicaAlreadyExistsException,
"ReplicaNotFoundException": newErrorReplicaNotFoundException,
"RequestLimitExceeded": newErrorRequestLimitExceeded,
"ResourceInUseException": newErrorResourceInUseException,
"ResourceNotFoundException": newErrorResourceNotFoundException,
"TableAlreadyExistsException": newErrorTableAlreadyExistsException,
"TableInUseException": newErrorTableInUseException,
"TableNotFoundException": newErrorTableNotFoundException,
"TransactionCanceledException": newErrorTransactionCanceledException,
"TransactionConflictException": newErrorTransactionConflictException,
"TransactionInProgressException": newErrorTransactionInProgressException,
}