Primo Committ
This commit is contained in:
71
vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClientException.php
vendored
Normal file
71
vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClientException.php
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* WooCommerce REST API HTTP Client Exception
|
||||
*
|
||||
* @category HttpClient
|
||||
* @package Automattic/WooCommerce
|
||||
*/
|
||||
|
||||
namespace Automattic\WooCommerce\HttpClient;
|
||||
|
||||
use Automattic\WooCommerce\HttpClient\Request;
|
||||
use Automattic\WooCommerce\HttpClient\Response;
|
||||
|
||||
/**
|
||||
* REST API HTTP Client Exception class.
|
||||
*
|
||||
* @package Automattic/WooCommerce
|
||||
*/
|
||||
class HttpClientException extends \Exception
|
||||
{
|
||||
/**
|
||||
* Request.
|
||||
*
|
||||
* @var Request
|
||||
*/
|
||||
private $request;
|
||||
|
||||
/**
|
||||
* Response.
|
||||
*
|
||||
* @var Response
|
||||
*/
|
||||
private $response;
|
||||
|
||||
/**
|
||||
* Initialize exception.
|
||||
*
|
||||
* @param string $message Error message.
|
||||
* @param int $code Error code.
|
||||
* @param Request $request Request data.
|
||||
* @param Response $response Response data.
|
||||
*/
|
||||
public function __construct($message, $code, Request $request, Response $response)
|
||||
{
|
||||
parent::__construct($message, $code);
|
||||
|
||||
$this->request = $request;
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get request data.
|
||||
*
|
||||
* @return Request
|
||||
*/
|
||||
public function getRequest()
|
||||
{
|
||||
return $this->request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get response data.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function getResponse()
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user