Author: Nicolas Ruflin (spam@ruflin.com)
Inheritance: extends RuntimeException, implements ExceptionInterface
 /**
  * Construct Exception
  *
  * @param \Elastica\Request $request
  * @param \Elastica\Response $response
  */
 public function __construct(Request $request, Response $response)
 {
     parent::__construct($request, $response);
     $shardsStatistics = $response->getShardsStatistics();
     $this->message = json_encode($shardsStatistics['failed']);
 }
 /**
  * Construct Exception.
  *
  * @param \Elastica\Request  $request
  * @param \Elastica\Response $response
  */
 public function __construct(Request $request, Response $response)
 {
     parent::__construct($request, $response);
     $shardsStatistics = $response->getShardsStatistics();
     $this->message = JSON::stringify($shardsStatistics);
 }