eZ\Bundle\EzPublishRestBundle\Features\Context\SubContext\EzRest::getResponseError PHP Method

getResponseError() protected method

Get property from the returned Exception.
protected getResponseError ( string $property ) : integer | mixed | string
$property string Property to return
return integer | mixed | string Property
    protected function getResponseError($property)
    {
        $exception = $this->getResponseObject();
        if (!$exception instanceof \Exception) {
            throw new InvalidArgumentException('response object', 'is not an exception');
        }
        switch ($property) {
            case 'code':
                return $exception->getCode();
            case 'description':
            case 'message':
                return $exception->getMessage();
        }
        throw new InvalidArgumentException($property, 'is invalid');
    }