Elastica\Response::getErrorMessage PHP Method

getErrorMessage() public method

public getErrorMessage ( ) : string
return string Error string based on the error object
    public function getErrorMessage()
    {
        $error = $this->getError();
        if (!is_string($error)) {
            $error = json_encode($error);
        }
        return $error;
    }

Usage Example

 /**
  * @group unit
  */
 public function testStringErrorMessage()
 {
     $response = new Response(json_encode(array('error' => 'a')));
     $this->assertEquals('a', $response->getErrorMessage());
 }
All Usage Examples Of Elastica\Response::getErrorMessage