$request
$request : \Psr\Http\Message\RequestInterface
Exception when an HTTP error occurs (4xx or 5xx error)
$request : \Psr\Http\Message\RequestInterface
$response : \Psr\Http\Message\ResponseInterface|null
$handlerContext : array
__construct(string $message, \Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response, \Throwable $previous = null, array $handlerContext = []) : mixed
string | $message | |
\Psr\Http\Message\RequestInterface | $request | |
\Psr\Http\Message\ResponseInterface | $response | |
\Throwable | $previous | |
array | $handlerContext |
create(\Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response = null, \Throwable|null $previous = null, array $handlerContext = [], \GuzzleHttp\BodySummarizerInterface|null $bodySummarizer = null) : self
Factory method to create a new exception with a normalized error message
\Psr\Http\Message\RequestInterface | $request | Request sent |
\Psr\Http\Message\ResponseInterface | $response | Response received |
\Throwable|null | $previous | Previous exception |
array | $handlerContext | Optional handler context |
\GuzzleHttp\BodySummarizerInterface|null | $bodySummarizer | Optional body summarizer |
getHandlerContext() : array
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.