Skip to content

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.

final class NetworkException extends TransportException implements NetworkExceptionInterface

ExtendsTransportException
ImplementsNetworkExceptionInterface
SourceHttp/Client/Exception/NetworkException.php

public function __construct(string $message, RequestInterface $request, ?Throwable $previous = null): mixed

ParameterTypeDescription
$messagestring
$requestRequestInterface
$previous?Throwable

Returns mixed

MethodDescription
getRequest(): RequestInterfaceReturns the request that could not be completed, as handed to the constructor.

public function getRequest(): RequestInterface

Returns the request that could not be completed, as handed to the constructor.

Returns RequestInterface

These come from an ancestor and are documented where they are declared.

MethodDeclared inDescription
getCode()Exception
getFile()Exception
getLine()Exception
getMessage()Exception
getPrevious()Exception
getTrace()Exception
getTraceAsString()Exception