Improve error reporting for missing index
This commit is contained in:
parent
3a42079ec7
commit
704a12146b
2 changed files with 9 additions and 5 deletions
|
|
@ -2655,14 +2655,15 @@ def test_query_by_non_exists_index():
|
|||
],
|
||||
)
|
||||
|
||||
with assert_raises(ValueError) as ex:
|
||||
with assert_raises(ClientError) as ex:
|
||||
dynamodb.query(
|
||||
TableName="test",
|
||||
IndexName="non_exists_index",
|
||||
KeyConditionExpression="CarModel=M",
|
||||
)
|
||||
|
||||
str(ex.exception).should.equal(
|
||||
ex.exception.response["Error"]["Code"].should.equal("ResourceNotFoundException")
|
||||
ex.exception.response["Error"]["Message"].should.equal(
|
||||
"Invalid index: non_exists_index for table: test. Available indexes are: test_gsi"
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue