SHOW:
|
|
- or go back to the newest paste.
1 | $client->getHandlerList()->appendSign(function (callable $handler) { | |
2 | return function (CommandInterface $command, RequestInterface $request = null) use ($handler) { | |
3 | return $handler($command, $request)->then(null, function(DynamoDbException $ex) { | |
4 | // Log the exception | |
5 | $response = json_decode($ex->getResponse()->getBody(), true); | |
6 | $request = $ex->getRequest(); | |
7 | ||
8 | $this->getLogger()->log(sprintf( | |
9 | 'message=%s&operation=%s&requestBody=%s&response=%s', | |
10 | urlencode($ex->getMessage()), | |
11 | urlencode($request->getHeaderLine('x-amz-target')), | |
12 | urlencode($request->getBody()), | |
13 | urlencode($response['message']) | |
14 | ), LOG_ERR); | |
15 | }); | |
16 | }; | |
17 | }); |