mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
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.
This commit is contained in:
1 parent
812911fd03
commit
58b2e5ff96
1 file changed
+2
-1
@@ -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) {}
|
||||
|
||||
Reference in new issue
Block a user