Skip to content

fix(server): send Message on the two errors the service sends it on - #774

Open
LeeroyHannigan wants to merge 1 commit into
mainfrom
fix/760-message-key-casing
Open

LeeroyHannigan wants to merge 1 commit into
mainfrom
fix/760-message-key-casing

Conversation

@LeeroyHannigan

Copy link
Copy Markdown
Collaborator

error_response wrote every error message under a lower-case message key. Amazon DynamoDB sends Message on TransactionCanceledException and IdempotentParameterMismatchException, and message on every other error measured. botocore reads either key, but a client that reads the modeled Message member of those two errors from the raw body found nothing.

Measurement

Amazon DynamoDB, us-east-1, raw body of a TransactWriteItems whose only member is a failing ConditionCheck, 3 November 2026, twice with the same answer:

{"__type":"com.amazonaws.dynamodb.v20120810#TransactionCanceledException","CancellationReasons":[{"Code":"ConditionalCheckFailed","Message":"The conditional request failed"}],"Message":"Transaction cancelled, please refer cancellation reasons for specific reasons [ConditionalCheckFailed]"}

#760 has the 29 October bodies of both errors, and the other errors captured that day with message.

Change

  • The key now comes from message_key, which picks Message for those two errors and message for every other one.
  • TransactionInProgressException also models its member as Message. It was not measured and ExtendDB does not raise it, so it keeps message.
  • REQ-ERR-002 in docs/design/01-requirements.md and the doc comment of error_response name the key.

The token mismatch text, which #760 also reports, is left to #526, so this pull request is part of #760 and does not close it.

Tests

  • A unit test in response_tests.rs checks the top-level keys of the body error_response sends for both errors and for ValidationException, ConditionalCheckFailedException and TransactionConflictException. It sits in its own file so that it does not collide with the test module feat(core): throttle errors carry the service's ThrottlingReasons #532 adds at the end of response.rs.
  • tests/test_error_message_key.py reads the raw body from botocore's before-parse event for a cancelled transaction, an idempotency token reused with different parameters, a failed condition and a validation error.

Testing

Part of #760.

error_response wrote every error message under a lower-case message key.
Amazon DynamoDB sends Message on TransactionCanceledException and
IdempotentParameterMismatchException, and message on every other error
measured. botocore reads either key, but a client that reads the modeled
Message member of those two errors from the raw body found nothing.

The key now comes from message_key, which picks Message for those two
errors and message for every other one. TransactionInProgressException
also models its member as Message; it was not measured and ExtendDB does
not raise it, so it keeps message. REQ-ERR-002 and the doc comment of
error_response name the key.

A unit test, in response_tests.rs, checks the top-level keys of the body
error_response sends for both errors and for three others.
tests/test_error_message_key.py reads the raw body from botocore's
before-parse event for a cancelled transaction, an idempotency token
reused with different parameters, a failed condition and a validation
error. It passes against Amazon DynamoDB in us-east-1 and against this
change; against a build of main the two Message tests fail.

The token mismatch text, which #760 also reports, is left to #526.

Part of #760.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant