Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

(no description)

File Size: 166 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

RequestException:: (8 methods):
  __construct()
  wrapException()
  create()
  obfuscateUri()
  getRequest()
  getResponse()
  hasResponse()
  getHandlerContext()


Class: RequestException  - X-Ref

HTTP Request exception

__construct(string $message,RequestInterface $request,ResponseInterface $response = null,\Throwable $previous = null,array $handlerContext = [])   X-Ref


wrapException(RequestInterface $request, \Throwable $e)   X-Ref
Wrap non-RequestExceptions with a RequestException


create(RequestInterface $request,ResponseInterface $response = null,\Throwable $previous = null,array $handlerContext = [],BodySummarizerInterface $bodySummarizer = null)   X-Ref
Factory method to create a new exception with a normalized error message

param: RequestInterface             $request        Request sent
param: ResponseInterface            $response       Response received
param: \Throwable|null              $previous       Previous exception
param: array                        $handlerContext Optional handler context
param: BodySummarizerInterface|null $bodySummarizer Optional body summarizer

obfuscateUri(UriInterface $uri)   X-Ref
Obfuscates URI if there is a username and a password present


getRequest()   X-Ref
Get the request that caused the exception


getResponse()   X-Ref
Get the associated response


hasResponse()   X-Ref
Check if a response was received


getHandlerContext()   X-Ref
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.