Open Journal Systems  3.3.0
GuzzleHttp\Exception\RequestException Class Reference
Inheritance diagram for GuzzleHttp\Exception\RequestException:
GuzzleHttp\Exception\TransferException GuzzleHttp\Exception\BadResponseException GuzzleHttp\Exception\ConnectException GuzzleHttp\Exception\TooManyRedirectsException GuzzleHttp\Exception\ClientException GuzzleHttp\Exception\ServerException

Public Member Functions

 __construct ( $message, RequestInterface $request, ResponseInterface $response=null, \Exception $previous=null, array $handlerContext=[])
 
 getHandlerContext ()
 
 getRequest ()
 
 getResponse ()
 
 hasResponse ()
 

Static Public Member Functions

static create (RequestInterface $request, ResponseInterface $response=null, \Exception $previous=null, array $ctx=[])
 
static getResponseBodySummary (ResponseInterface $response)
 
static wrapException (RequestInterface $request, \Exception $e)
 

Detailed Description

HTTP Request exception

Definition at line 12 of file vendor/guzzlehttp/guzzle/src/Exception/RequestException.php.

Constructor & Destructor Documentation

◆ __construct()

GuzzleHttp\Exception\RequestException::__construct (   $message,
RequestInterface  $request,
ResponseInterface  $response = null,
\Exception  $previous = null,
array  $handlerContext = [] 
)

Member Function Documentation

◆ create()

static GuzzleHttp\Exception\RequestException::create ( RequestInterface  $request,
ResponseInterface  $response = null,
\Exception  $previous = null,
array  $ctx = [] 
)
static

Factory method to create a new exception with a normalized error message

Parameters
RequestInterface$requestRequest
ResponseInterface$responseResponse received
\Exception$previousPrevious exception
array$ctxOptional handler context.
Returns
self

Definition at line 74 of file vendor/guzzlehttp/guzzle/src/Exception/RequestException.php.

References Psr\Http\Message\RequestInterface\getMethod(), and Psr\Http\Message\RequestInterface\getUri().

◆ getHandlerContext()

GuzzleHttp\Exception\RequestException::getHandlerContext ( )

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.

Returns
array

Definition at line 197 of file vendor/guzzlehttp/guzzle/src/Exception/RequestException.php.

◆ getRequest()

GuzzleHttp\Exception\RequestException::getRequest ( )

Get the request that caused the exception

Returns
RequestInterface

Definition at line 162 of file vendor/guzzlehttp/guzzle/src/Exception/RequestException.php.

◆ getResponse()

GuzzleHttp\Exception\RequestException::getResponse ( )

Get the associated response

Returns
ResponseInterface|null

Reimplemented in GuzzleHttp\Exception\ConnectException.

Definition at line 172 of file vendor/guzzlehttp/guzzle/src/Exception/RequestException.php.

Referenced by GuzzleHttp\Middleware\log().

◆ getResponseBodySummary()

static GuzzleHttp\Exception\RequestException::getResponseBodySummary ( ResponseInterface  $response)
static

Get a short summary of the response

Will return null if the response is not printable.

Parameters
ResponseInterface$response
Returns
string|null

Definition at line 134 of file vendor/guzzlehttp/guzzle/src/Exception/RequestException.php.

◆ hasResponse()

GuzzleHttp\Exception\RequestException::hasResponse ( )

Check if a response was received

Returns
bool

Reimplemented in GuzzleHttp\Exception\ConnectException.

Definition at line 182 of file vendor/guzzlehttp/guzzle/src/Exception/RequestException.php.

◆ wrapException()

static GuzzleHttp\Exception\RequestException::wrapException ( RequestInterface  $request,
\Exception  $e 
)
static

Wrap non-RequestExceptions with a RequestException

Parameters
RequestInterface$request
\Exception$e
Returns
RequestException

Definition at line 57 of file vendor/guzzlehttp/guzzle/src/Exception/RequestException.php.

Referenced by GuzzleHttp\Handler\StreamHandler\__invoke().


The documentation for this class was generated from the following file: