← All changes
|
vendor_prefixed/guzzlehttp/guzzle/src/Exception/ConnectException.php
+25
-11
18.2
→
trunk
View file →
| @@ -1,31 +1,45 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace YoastSEO_Vendor\GuzzleHttp\Exception; |
| 4 | 4 | |
| 5 | +use YoastSEO_Vendor\Psr\Http\Client\NetworkExceptionInterface; | |
| 5 | 6 | use YoastSEO_Vendor\Psr\Http\Message\RequestInterface; |
| 6 | 7 | /** |
| 7 | 8 | * Exception thrown when a connection cannot be established. |
| 8 | - * | |
| 9 | - * Note that no response is present for a ConnectException | |
| 10 | 9 | */ |
| 11 | -class ConnectException extends \YoastSEO_Vendor\GuzzleHttp\Exception\RequestException | |
| 10 | +class ConnectException extends \YoastSEO_Vendor\GuzzleHttp\Exception\TransferException implements \YoastSEO_Vendor\Psr\Http\Client\NetworkExceptionInterface | |
| 12 | 11 | { |
| 13 | - public function __construct($message, \YoastSEO_Vendor\Psr\Http\Message\RequestInterface $request, \Exception $previous = null, array $handlerContext = []) | |
| 12 | + /** | |
| 13 | + * @var RequestInterface | |
| 14 | + */ | |
| 15 | + private $request; | |
| 16 | + /** | |
| 17 | + * @var array | |
| 18 | + */ | |
| 19 | + private $handlerContext; | |
| 20 | + public function __construct(string $message, \YoastSEO_Vendor\Psr\Http\Message\RequestInterface $request, ?\Throwable $previous = null, array $handlerContext = []) | |
| 14 | 21 | { |
| 15 | - parent::__construct($message, $request, null, $previous, $handlerContext); | |
| 22 | + parent::__construct($message, 0, $previous); | |
| 23 | + $this->request = $request; | |
| 24 | + $this->handlerContext = $handlerContext; | |
| 16 | 25 | } |
| 17 | 26 | /** |
| 18 | - * @return null | |
| 27 | + * Get the request that caused the exception | |
| 19 | 28 | */ |
| 20 | - public function getResponse() | |
| 29 | + public function getRequest() : \YoastSEO_Vendor\Psr\Http\Message\RequestInterface | |
| 21 | 30 | { |
| 22 | - return null; | |
| 31 | + return $this->request; | |
| 23 | 32 | } |
| 24 | 33 | /** |
| 25 | - * @return bool | |
| 34 | + * Get contextual information about the error from the underlying handler. | |
| 35 | + * | |
| 36 | + * The contents of this array will vary depending on which handler you are | |
| 37 | + * using. It may also be just an empty array. Relying on this data will | |
| 38 | + * couple you to a specific handler, but can give more debug information | |
| 39 | + * when needed. | |
| 26 | 40 | */ |
| 27 | - public function hasResponse() | |
| 41 | + public function getHandlerContext() : array | |
| 28 | 42 | { |
| 29 | - return \false; | |
| 43 | + return $this->handlerContext; | |
| 30 | 44 | } |
| 31 | 45 | } |