PHP PSR

RequestException extends ClientException
in package
implements RequestExceptionInterface

Exception for when a request failed.

Examples:

  • Request is invalid (e.g. method is missing)
  • Runtime request errors (e.g. the body stream is not seekable)

Table of Contents

Interfaces

RequestExceptionInterface

Properties

$request  : RequestInterface

Methods

__construct()  : mixed
Client exception construction.
getRequest()  : RequestInterface
Returns the request.

Properties

Methods

__construct()

Client exception construction.

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

Client request

$message : string = ''

The exception message

$code : int = 0

The exception code

$previous : Throwable|null = null

Previous throwable

getRequest()

Returns the request.

public getRequest() : RequestInterface

The request object MAY be a different object from the one passed to ClientInterface::sendRequest()

Return values
RequestInterface

        
On this page

Search results