Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $client->getHandlerList()->appendSign(function (callable $handler) {
- return function (CommandInterface $command, RequestInterface $request = null) use ($handler) {
- return $handler($command, $request)->then(null, function(DynamoDbException $ex) {
- // Log the exception
- $response = json_decode($ex->getResponse()->getBody(), true);
- $request = $ex->getRequest();
- $this->getLogger()->log(sprintf(
- 'message=%s&operation=%s&requestBody=%s&response=%s',
- urlencode($ex->getMessage()),
- urlencode($request->getHeaderLine('x-amz-target')),
- urlencode($request->getBody()),
- urlencode($response['message'])
- ), LOG_ERR);
- });
- };
- });
Add Comment
Please, Sign In to add comment