From 58b2e5ff9610943e02337f484ebc1067bd395e50 Mon Sep 17 00:00:00 2001 From: Hector Ventura Date: Wed, 2 Sep 2026 21:27:27 -0500 Subject: [PATCH] fix(dynamodb): name the table in the ResourceNotFoundException message (#2929) Every table lookup returned a bare "Requested resource not found", omitting the table name that real AWS includes. DynamoDB is the service most people exercise first and error-text assertions are common in its test suites, so the mismatch tends to surface in the first hour rather than late. The expected text is not settled by the botocore model, which declares only a message member with no template. It comes from AWS's own SDK tests: the aws-sdk-js-v3 DynamoDB e2e spec asserts "Requested resource not found: Table: DynamoDB not found", and aws-sdk-ruby's client.feature asserts the same shape against a real endpoint. moto composes the identical string. resourceNotFoundException already accepted the table name and discarded it. All fifteen call sites are table lookups, so interpolating in the helper is correct for every caller and matches findTableByArn, which already names the resource it failed to find. That method keeps its ARN-shaped message because it resolves by ARN rather than by name. Verified on the wire: DescribeTable on a missing table now returns {"__type":"ResourceNotFoundException","message":"Requested resource not found: Table: nope not found"}. No test asserted the old text, and the DynamoDB suites stay green at 1362 tests. --- .../hectorvent/floci/services/dynamodb/DynamoDbService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/hectorvent/floci/services/dynamodb/DynamoDbService.java b/src/main/java/io/github/hectorvent/floci/services/dynamodb/DynamoDbService.java index c690975b29..ae55a3cec6 100644 --- a/src/main/java/io/github/hectorvent/floci/services/dynamodb/DynamoDbService.java +++ b/src/main/java/io/github/hectorvent/floci/services/dynamodb/DynamoDbService.java @@ -2866,7 +2866,8 @@ public class DynamoDbService implements ResourceProvider { } private AwsException resourceNotFoundException(String tableName) { - return new AwsException("ResourceNotFoundException", "Requested resource not found", 400); + return new AwsException("ResourceNotFoundException", + "Requested resource not found: Table: " + tableName + " not found", 400); } public record UpdateResult(JsonNode newItem, JsonNode oldItem) {}