Open boxabirds opened 4 years ago
Hmm I don't think it's doing any error mapping AFAIK. How do you know it was a 400
error?
Ah yes so when I try and run the query directly using the dynamodb cli it produces the 400 error.
The column is "noteId" as per book, but I had "nodeId" and it produced this error:
https://aws.amazon.com/premiumsupport/knowledge-center/key-element-error-dynamodb-hive-emr/
… which is error 400 apparently.
aws dynamodb update-item --cli-input-json '{
"TableName": "notes", "Key": { "userId": { "S": "us-east-1:…" },
"noteId": { "S": "5bb9e890…" }
},
"UpdateExpression": "SET content = :content, attachment = :attachment",
"ExpressionAttributeValues": {
":attachment": { "S": "hello.jpg" },
":content": { "S": "hello world" }
},
"ReturnValues": "ALL_NEW"
}
'
Right but the Lambda function returns a 500 error? The CLI isn't doing any remapping in this case right?
Firstly thanks for this tool! It is really useful for debugging issues.
And also, I spent a big chunk of time hunting down what was in the end a simple typo in my code for the name of the primary index column. One of the problems that slightly exacerbated it was that the HTTP status code returned was
500
but under the hood it's actually400
. E.g.Digging into the code a bit to see where this mapping was, I noticed this CLI utility, as helpful as it is, seems to refer to this independent AWS client. I'm confused because that repository does have headers that say copyright Amazon; I can only presume this is a fork?
The issue is I don't think the
400
code should be mapped to a500
code as this loses important information and is hard to trace back to official AWS docs when the code has been changed.