diff options
author | Andrew Dolgov <[email protected]> | 2023-10-20 17:12:29 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2023-10-20 21:13:39 +0300 |
commit | cdd7ad020e165fe680703b6d3319b908b682fb7a (patch) | |
tree | b51eb09b7b4587e8fbc5624ac8d88d28cfcd0b04 /vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php | |
parent | 45a9ff0c88cbd33892ff16ab837e9059937d656e (diff) |
jaeger-client -> opentelemetry
Diffstat (limited to 'vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php')
-rw-r--r-- | vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php b/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php new file mode 100644 index 000000000..a80956c9d --- /dev/null +++ b/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php @@ -0,0 +1,39 @@ +<?php + +namespace GuzzleHttp\Exception; + +use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\ResponseInterface; + +/** + * Exception when an HTTP error occurs (4xx or 5xx error) + */ +class BadResponseException extends RequestException +{ + public function __construct( + string $message, + RequestInterface $request, + ResponseInterface $response, + \Throwable $previous = null, + array $handlerContext = [] + ) { + parent::__construct($message, $request, $response, $previous, $handlerContext); + } + + /** + * Current exception and the ones that extend it will always have a response. + */ + public function hasResponse(): bool + { + return true; + } + + /** + * This function narrows the return type from the parent class and does not allow it to be nullable. + */ + public function getResponse(): ResponseInterface + { + /** @var ResponseInterface */ + return parent::getResponse(); + } +} |