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');
}