Elastica\Exception\ResponseException::__construct PHP Method

__construct() public method

Construct Exception.
public __construct ( Request $request, Response $response )
$request Elastica\Request
$response Elastica\Response
    public function __construct(Request $request, Response $response)
    {
        $this->_request = $request;
        $this->_response = $response;
        parent::__construct($response->getErrorMessage());
    }

Usage Example

 /**
  * 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']);
 }
All Usage Examples Of Elastica\Exception\ResponseException::__construct