Fix: DynamoDB:GetItem throws wrong error when table doesn't exist (#3700)
* Fix: DynamoDB:GetItem throws wrong error when table doesn't exist * Use unique exception for table not found, per PR feedback * Just fix the reported issue, without touching anything else...
This commit is contained in:
parent
6f1eae6f02
commit
613b1395b8
2 changed files with 15 additions and 0 deletions
|
|
@ -349,6 +349,12 @@ class DynamoHandler(BaseResponse):
|
|||
|
||||
def get_item(self):
|
||||
name = self.body["TableName"]
|
||||
table = self.dynamodb_backend.get_table(name)
|
||||
if table is None:
|
||||
return self.error(
|
||||
"com.amazonaws.dynamodb.v20120810#ResourceNotFoundException",
|
||||
"Requested resource not found",
|
||||
)
|
||||
key = self.body["Key"]
|
||||
projection_expression = self.body.get("ProjectionExpression")
|
||||
expression_attribute_names = self.body.get("ExpressionAttributeNames", {})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue