class ConnectException
Exception thrown when a connection cannot be established.
Note that no response is present for a ConnectException
Hierarchy
- class \GuzzleHttp\Exception\TransferException extends \GuzzleHttp\Exception\RuntimeException implements \GuzzleHttp\Exception\GuzzleException
- class \GuzzleHttp\Exception\ConnectException extends \GuzzleHttp\Exception\TransferException implements \Psr\Http\Client\NetworkExceptionInterface
Expanded class hierarchy of ConnectException
3 files declare their use of ConnectException
- CurlFactory.php in vendor/
guzzlehttp/ guzzle/ src/ Handler/ CurlFactory.php - locale.batch.inc in core/
modules/ locale/ locale.batch.inc - StreamHandler.php in vendor/
guzzlehttp/ guzzle/ src/ Handler/ StreamHandler.php
File
-
vendor/
guzzlehttp/ guzzle/ src/ Exception/ ConnectException.php, line 13
Namespace
GuzzleHttp\ExceptionView source
class ConnectException extends TransferException implements NetworkExceptionInterface {
/**
* @var RequestInterface
*/
private $request;
/**
* @var array
*/
private $handlerContext;
public function __construct(string $message, RequestInterface $request, ?\Throwable $previous = null, array $handlerContext = []) {
parent::__construct($message, 0, $previous);
$this->request = $request;
$this->handlerContext = $handlerContext;
}
/**
* Get the request that caused the exception
*/
public function getRequest() : RequestInterface {
return $this->request;
}
/**
* Get contextual information about the error from the underlying handler.
*
* The contents of this array will vary depending on which handler you are
* using. It may also be just an empty array. Relying on this data will
* couple you to a specific handler, but can give more debug information
* when needed.
*/
public function getHandlerContext() : array {
return $this->handlerContext;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
ConnectException::$handlerContext | private | property | ||
ConnectException::$request | private | property | ||
ConnectException::getHandlerContext | public | function | Get contextual information about the error from the underlying handler. | |
ConnectException::getRequest | public | function | Get the request that caused the exception | Overrides NetworkExceptionInterface::getRequest |
ConnectException::__construct | public | function |