2016-06-25 16:34:48 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Patch testing component for the Joomla! CMS
|
|
|
|
*
|
2018-09-01 14:32:23 +00:00
|
|
|
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 - 2018 Open Source Matters, Inc. All rights reserved.
|
2016-06-25 16:34:48 +00:00
|
|
|
* @license GNU General Public License version 2 or later
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace PatchTester\GitHub\Exception;
|
|
|
|
|
2017-08-17 23:22:01 +00:00
|
|
|
use Joomla\CMS\Http\Response;
|
|
|
|
|
2016-06-25 16:34:48 +00:00
|
|
|
/**
|
|
|
|
* Exception representing an unexpected response
|
|
|
|
*
|
2016-06-25 17:46:15 +00:00
|
|
|
* @since 3.0.0
|
2016-06-25 16:34:48 +00:00
|
|
|
*/
|
|
|
|
class UnexpectedResponse extends \DomainException
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The Response object.
|
|
|
|
*
|
2017-08-17 23:22:01 +00:00
|
|
|
* @var Response
|
2016-06-25 17:46:15 +00:00
|
|
|
* @since 3.0.0
|
2016-06-25 16:34:48 +00:00
|
|
|
*/
|
|
|
|
private $response;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
2017-08-17 23:22:01 +00:00
|
|
|
* @param Response $response The Response object.
|
|
|
|
* @param string $message The Exception message to throw.
|
|
|
|
* @param integer $code The Exception code.
|
|
|
|
* @param \Exception $previous The previous exception used for the exception chaining.
|
2016-06-25 16:34:48 +00:00
|
|
|
*
|
2016-06-25 17:46:15 +00:00
|
|
|
* @since 3.0.0
|
2016-06-25 16:34:48 +00:00
|
|
|
*/
|
2017-08-17 23:22:01 +00:00
|
|
|
public function __construct(Response $response, $message = '', $code = 0, \Exception $previous = null)
|
2016-06-25 16:34:48 +00:00
|
|
|
{
|
|
|
|
parent::__construct($message, $code, $previous);
|
|
|
|
|
|
|
|
$this->response = $response;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the Response object.
|
|
|
|
*
|
2017-08-17 23:22:01 +00:00
|
|
|
* @return Response
|
2016-06-25 16:34:48 +00:00
|
|
|
*
|
2017-08-17 23:22:01 +00:00
|
|
|
* @since 3.0.0
|
2016-06-25 16:34:48 +00:00
|
|
|
*/
|
|
|
|
public function getResponse()
|
|
|
|
{
|
|
|
|
return $this->response;
|
|
|
|
}
|
|
|
|
}
|