1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
<?php
namespace Gedcomx\Rs\Client\Exception;
use GuzzleHttp\Psr7\Response;
/**
* Represents an exception within the FamilySearch GEDCOM X application.
*
* Class GedcomxApplicationException
*
* @package Gedcomx\Rs\Client\Exception
*/
class GedcomxApplicationException extends \Exception
{
/**
* The response associated with the exception if applicable.
*
* @var Response
*/
protected $response;
/**
* Constructs a new GEDCOM X application exception.
*
* @param string $message [optional]
* @param Response $response [optional]
* @param null $previous
*/
function __construct($message = "", $response = null, $previous = null)
{
$code = ($response == null ? 0 : $response->getStatusCode());
parent::__construct($message, $code, $previous);
$this->response = $response;
}
/**
* Gets the response associated with the exception if applicable.
*
* @return \GuzzleHttp\Psr7\Response
*/
public function getResponse()
{
return $this->response;
}
}