Golang SDK for Dynamodb : ReturnValuesOnConditionCheckFailure does not return the details about conditions when conditionchcekfailure occurs

0

I am using golang sdk [https://pkg.go.dev/github.com/aws/aws-sdk-go@v1.45.26/] to debug conditional check errors and find information about why the failure occured in sIngle write operations, but I can only see the error Message_: "The conditional request failed". No other information regarding specific reason is provided when using the parameter ReturnValuesOnConditionCheckFailure: ALL_OLD in UpdateItemInput. In case of TransactWriteItems I can see specific reason of conditional check failure when using the same parameter. How can I obtain those details for single write operations as well? Reference: [https://aws.amazon.com/about-aws/whats-new/2023/06/amazon-dynamodb-cost-failed-conditional-writes] The syntax I am using:

input := &dynamodb.UpdateItemInput{
		TableName:                           aws.String("DummyTable"),
		Key:                                 keyAttr,
		ExpressionAttributeValues:           updateExpr.Values(),
		ExpressionAttributeNames:            updateExpr.Names(),
		ConditionExpression:                 updateExpr.Condition(),
		ReturnValues:                        aws.String(dynamodb.ReturnValueAllOld),
		UpdateExpression:                    updateExpr.Update(),
		ReturnValuesOnConditionCheckFailure: aws.String(dynamodb.ReturnValuesOnConditionCheckFailureAllOld),
}
output, err := dl.ddbI.UpdateItem(input)
Megha
질문됨 7달 전334회 조회
1개 답변
0
수락된 답변

The issue was occurring because I was trying to use this feature with Dynamodb Local, however it is not not supported as of yet. When using AWS Dynamodb the details about the item can be seen in the error itself.

Megha
답변함 7달 전
profile picture
전문가
검토됨 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠