Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
Public Member Functions | |
__construct (string $message, RequestInterface $request, ResponseInterface $response=null, Throwable $previous=null, array $handlerContext=[]) | |
getHandlerContext () | |
Get contextual information about the error from the underlying handler. | |
getRequest () | |
Get the request that caused the exception. | |
getResponse () | |
Get the associated response. | |
hasResponse () | |
Check if a response was received. | |
Static Public Member Functions | |
static | create (RequestInterface $request, ResponseInterface $response=null, Throwable $previous=null, array $handlerContext=[], BodySummarizerInterface $bodySummarizer=null) |
Factory method to create a new exception with a normalized error message. | |
static | wrapException (RequestInterface $request, Throwable $e) |
Wrap non-RequestExceptions with a RequestException. | |
|
static |
Factory method to create a new exception with a normalized error message.
RequestInterface | $request | Request sent |
ResponseInterface | $response | Response received |
Throwable | null | $previous | Previous exception |
array | $handlerContext | Optional handler context |
BodySummarizerInterface | null | $bodySummarizer | Optional body summarizer |
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.
GuzzleHttp\Exception\RequestException::getRequest | ( | ) |
Get the request that caused the exception.
Implements Psr\Http\Client\RequestExceptionInterface.
GuzzleHttp\Exception\RequestException::getResponse | ( | ) |
Get the associated response.
Reimplemented in GuzzleHttp\Exception\BadResponseException.
GuzzleHttp\Exception\RequestException::hasResponse | ( | ) |
Check if a response was received.
Reimplemented in GuzzleHttp\Exception\BadResponseException.