Properly check for errors in PutItem and AddItem