Asanga Dewaguru
Asanga Dewaguru

Reputation: 1098

How to know the Dynamodb updateItem response status in AWS SDK for PHP

I'm running an update item statement to update a item in a table. I'm accessing dynamoDB via AWS SDK for PHP. But at the end of the execution how do I know whether the particular update has been successfully completed. by looking at the returned results.

eg:-

$response = $client->updateItem(....)

//How do I do this properly
if($response == 'successfull'){
}
else{
....
}

Upvotes: 0

Views: 952

Answers (1)

Jeremy Lindblom
Jeremy Lindblom

Reputation: 6527

You can assume success, unless an exception is thrown.

try {
    $result = $client->updateItem(...);
} catch (\Aws\DynamoDb\Exception\DynamoDbException $e) {
    // handle error
}

// handle result

Here are more details from the AWS SDK for PHP User Guide.

Upvotes: 1

Related Questions