NetworkException
PSR-18 network failure: the request could not be sent / no response was received (DNS failure, connection refused/reset, timeout).
These are the failures the retry policy treats as transient.
Synopsis
Section titled “Synopsis”final class NetworkException extends TransportException implements NetworkExceptionInterface
| Extends | TransportException |
| Implements | NetworkExceptionInterface |
| Source | Http/Client/Exception/NetworkException.php |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(string $message, RequestInterface $request, ?Throwable $previous = null): mixed
| Parameter | Type | Description |
|---|---|---|
$message | string | |
$request | RequestInterface | |
$previous | ?Throwable |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
getRequest(): RequestInterface | Returns the request that could not be completed, as handed to the constructor. |
getRequest()
Section titled “getRequest()”public function getRequest(): RequestInterface
Returns the request that could not be completed, as handed to the constructor.
Returns RequestInterface
Inherited methods
Section titled “Inherited methods”These come from an ancestor and are documented where they are declared.
| Method | Declared in | Description |
|---|---|---|
getCode() | Exception | |
getFile() | Exception | |
getLine() | Exception | |
getMessage() | Exception | |
getPrevious() | Exception | |
getTrace() | Exception | |
getTraceAsString() | Exception |