Alpha ZealPHP is early-stage and under active development. APIs may change between minor versions until v1.0. Feedback and bug reports welcome on GitHub.
API Index — Namespaces, Packages, Reports, Indices

NetworkException extends RuntimeException
in package
implements NetworkExceptionInterface

PSR-18 NetworkExceptionInterface implementation.

Thrown (or returned as the $error field of HTTPResponse) when an outbound HTTP request fails at the transport layer — DNS resolution failure, TCP connect timeout, TLS handshake error, etc. — before any HTTP response status is received. Carries the originating RequestInterface so callers can inspect or retry the failed request.

Table of Contents

Interfaces

NetworkExceptionInterface

Properties

$request  : RequestInterface

Methods

__construct()  : mixed
getRequest()  : RequestInterface
Returns the request that triggered this network exception.

Properties

Methods

__construct()

public __construct(RequestInterface $request[, string $message = '' ][, int $code = 0 ][, Throwable|null $previous = null ]) : mixed
Parameters
$request : RequestInterface

The request that triggered the network failure.

$message : string = ''

Human-readable error description.

$code : int = 0

Optional error code (defaults to 0).

$previous : Throwable|null = null

Underlying cause, if any.

getRequest()

Returns the request that triggered this network exception.

public getRequest() : RequestInterface
Return values
RequestInterface
On this page