aboutsummaryrefslogtreecommitdiff
path: root/vendor/php-http/httplug/src/Exception
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2024-10-01 18:10:28 +0300
committerAndrew Dolgov <fox@fakecake.org>2024-10-01 18:10:28 +0300
commit2ea888fdc687621e8ad6bce3ecb7a8e19cb7a87b (patch)
treef36ece9dd8816ac2e30b54bb38a019925270d356 /vendor/php-http/httplug/src/Exception
parentdf33ddaea1e46b5b923440d6383fa3ae85c4d60b (diff)
drop php-http/guzzle7-adapter
Diffstat (limited to 'vendor/php-http/httplug/src/Exception')
-rw-r--r--vendor/php-http/httplug/src/Exception/HttpException.php65
-rw-r--r--vendor/php-http/httplug/src/Exception/NetworkException.php28
-rw-r--r--vendor/php-http/httplug/src/Exception/RequestAwareTrait.php26
-rw-r--r--vendor/php-http/httplug/src/Exception/RequestException.php29
-rw-r--r--vendor/php-http/httplug/src/Exception/TransferException.php14
5 files changed, 0 insertions, 162 deletions
diff --git a/vendor/php-http/httplug/src/Exception/HttpException.php b/vendor/php-http/httplug/src/Exception/HttpException.php
deleted file mode 100644
index 6c2a007a0..000000000
--- a/vendor/php-http/httplug/src/Exception/HttpException.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-
-namespace Http\Client\Exception;
-
-use Psr\Http\Message\RequestInterface;
-use Psr\Http\Message\ResponseInterface;
-
-/**
- * Thrown when a response was received but the request itself failed.
- *
- * In addition to the request, this exception always provides access to the response object.
- *
- * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
- */
-class HttpException extends RequestException
-{
- /**
- * @var ResponseInterface
- */
- protected $response;
-
- /**
- * @param string $message
- */
- public function __construct(
- $message,
- RequestInterface $request,
- ResponseInterface $response,
- \Exception $previous = null
- ) {
- parent::__construct($message, $request, $previous);
-
- $this->response = $response;
- $this->code = $response->getStatusCode();
- }
-
- /**
- * Returns the response.
- *
- * @return ResponseInterface
- */
- public function getResponse()
- {
- return $this->response;
- }
-
- /**
- * Factory method to create a new exception with a normalized error message.
- */
- public static function create(
- RequestInterface $request,
- ResponseInterface $response,
- \Exception $previous = null
- ) {
- $message = sprintf(
- '[url] %s [http method] %s [status code] %s [reason phrase] %s',
- $request->getRequestTarget(),
- $request->getMethod(),
- $response->getStatusCode(),
- $response->getReasonPhrase()
- );
-
- return new static($message, $request, $response, $previous);
- }
-}
diff --git a/vendor/php-http/httplug/src/Exception/NetworkException.php b/vendor/php-http/httplug/src/Exception/NetworkException.php
deleted file mode 100644
index 9b4f1e8fd..000000000
--- a/vendor/php-http/httplug/src/Exception/NetworkException.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-namespace Http\Client\Exception;
-
-use Psr\Http\Client\NetworkExceptionInterface as PsrNetworkException;
-use Psr\Http\Message\RequestInterface;
-
-/**
- * Thrown when the request cannot be completed because of network issues.
- *
- * There is no response object as this exception is thrown when no response has been received.
- *
- * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
- */
-class NetworkException extends TransferException implements PsrNetworkException
-{
- use RequestAwareTrait;
-
- /**
- * @param string $message
- */
- public function __construct($message, RequestInterface $request, \Exception $previous = null)
- {
- $this->setRequest($request);
-
- parent::__construct($message, 0, $previous);
- }
-}
diff --git a/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php b/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php
deleted file mode 100644
index 71b4bb8c9..000000000
--- a/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-namespace Http\Client\Exception;
-
-use Psr\Http\Message\RequestInterface;
-
-trait RequestAwareTrait
-{
- /**
- * @var RequestInterface
- */
- private $request;
-
- private function setRequest(RequestInterface $request)
- {
- $this->request = $request;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getRequest(): RequestInterface
- {
- return $this->request;
- }
-}
diff --git a/vendor/php-http/httplug/src/Exception/RequestException.php b/vendor/php-http/httplug/src/Exception/RequestException.php
deleted file mode 100644
index f6c60ce56..000000000
--- a/vendor/php-http/httplug/src/Exception/RequestException.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-namespace Http\Client\Exception;
-
-use Psr\Http\Client\RequestExceptionInterface as PsrRequestException;
-use Psr\Http\Message\RequestInterface;
-
-/**
- * Exception for when a request failed, providing access to the failed request.
- *
- * This could be due to an invalid request, or one of the extending exceptions
- * for network errors or HTTP error responses.
- *
- * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
- */
-class RequestException extends TransferException implements PsrRequestException
-{
- use RequestAwareTrait;
-
- /**
- * @param string $message
- */
- public function __construct($message, RequestInterface $request, \Exception $previous = null)
- {
- $this->setRequest($request);
-
- parent::__construct($message, 0, $previous);
- }
-}
diff --git a/vendor/php-http/httplug/src/Exception/TransferException.php b/vendor/php-http/httplug/src/Exception/TransferException.php
deleted file mode 100644
index a858cf5ec..000000000
--- a/vendor/php-http/httplug/src/Exception/TransferException.php
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php
-
-namespace Http\Client\Exception;
-
-use Http\Client\Exception;
-
-/**
- * Base exception for transfer related exceptions.
- *
- * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
- */
-class TransferException extends \RuntimeException implements Exception
-{
-}