Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CancellationReason missing Item #1225

Open
knap1930 opened this issue Feb 10, 2024 · 0 comments
Open

CancellationReason missing Item #1225

knap1930 opened this issue Feb 10, 2024 · 0 comments

Comments

@knap1930
Copy link
Contributor

When sending "ReturnValuesOnConditionCheckFailure": "ALL_OLD" for a transaction, there is no way to access the item that failed the condition check. here is an example response copied from getmoto/moto#5204

{'CancellationReasons': [{'Code': 'ConditionalCheckFailed',
                          'Item': {'customer': {'S': 'mark'},
                                   'lock': {'M': {'acquired_at': {'N': '123'}}},
                                   'mealtime': {'S': 'breakfast'}},
                          'Message': 'The conditional request failed'}],
 'Error': {'Code': 'TransactionCanceledException',
           'Message': 'Transaction cancelled, please refer cancellation '
                      'reasons for specific reasons [ConditionalCheckFailed]'},
 'Message': 'Transaction cancelled, please refer cancellation reasons for '
            'specific reasons [ConditionalCheckFailed]',
 'ResponseMetadata': {'HTTPHeaders': {'connection': 'keep-alive',
                                      'content-length': '393',
                                      'content-type': 'application/x-amz-json-1.0',
                                      'date': 'Wed, 08 Jun 2022 18:55:51 GMT',
                                      'server': 'Server',
                                      'x-amz-crc32': '947576560',
                                      'x-amzn-requestid': 'BDBL292TOK52OSPP0GTJTTS2CVVV4KQNSO5AEMVJF66Q9ASUAAJG'},
                      'HTTPStatusCode': 400,
                      'RequestId': 'BDBL292TOK52OSPP0GTJTTS2CVVV4KQNSO5AEMVJF66Q9ASUAAJG',
                      'RetryAttempts': 0}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant