getErrorMessage() public method

public getErrorMessage ( ) : string
return string Error string based on the error object
 /**
  * @group unit
  */
 public function testStringErrorMessage()
 {
     $response = new Response(json_encode(array('error' => 'a')));
     $this->assertEquals('a', $response->getErrorMessage());
 }
Example #2
0
 /**
  * Construct Exception.
  *
  * @param \Elastica\Request  $request
  * @param \Elastica\Response $response
  */
 public function __construct(Request $request, Response $response)
 {
     $this->_request = $request;
     $this->_response = $response;
     parent::__construct($response->getErrorMessage());
 }