#[non_exhaustive]
pub struct TransactionCanceledException { pub message: Option<String>, pub cancellation_reasons: Option<Vec<CancellationReason>>, }
Expand description

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.

Fields (Non-exhaustive)

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
message: Option<String>cancellation_reasons: Option<Vec<CancellationReason>>

A list of cancellation reasons.

Implementations

A list of cancellation reasons.

Returns the error message.

Creates a new builder-style object to manufacture TransactionCanceledException

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more