HTTP Request exception

Instantiable
ExtendsGuzzleHttp\Exception\TransferException
RuntimeException
Exception
ImplementsGuzzleHttp\Exception\GuzzleException
Throwable
Methods
public __construct( $message, Psr\Http\Message\RequestInterface $request, ?Psr\Http\Message\ResponseInterface $response = NULL, ?Exception $previous = NULL, array $handlerContext = [])
public Exception::__toString()
public Exception::__wakeup()
public static create(Psr\Http\Message\RequestInterface $request, ?Psr\Http\Message\ResponseInterface $response = NULL, ?Exception $previous = NULL, array $ctx = [])
 
Factory method to create a new exception with a normalized error message

  • return self
public final Exception::getCode()
public final Exception::getFile()
public 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.

  • return array
public final Exception::getLine()
public final Exception::getMessage()
public final Exception::getPrevious()
public getRequest()
 
Get the request that caused the exception

  • return RequestInterface
public getResponse()
 
Get the associated response

  • return ResponseInterface|null
public static getResponseBodySummary(Psr\Http\Message\ResponseInterface $response)
 
Get a short summary of the response

Will return null if the response is not printable.

  • return string|null
public final Exception::getTrace()
public final Exception::getTraceAsString()
public hasResponse()
 
Check if a response was received

  • return bool
public static wrapException(Psr\Http\Message\RequestInterface $request, Exception $e)
 
Wrap non-RequestExceptions with a RequestException

Properties
protected Exception::$code
protected Exception::$file
protected Exception::$line
protected Exception::$message
Properties
private $handlerContext
 


  • var array
private $request
 


  • var RequestInterface
private $response
 


  • var ResponseInterface|null
Methods
private final Exception::__clone()
private static obfuscateUri(Psr\Http\Message\UriInterface $uri)
 
Obfuscates URI if there is a username and a password present

  • return UriInterface
Methods
public static create(Psr\Http\Message\RequestInterface $request, ?Psr\Http\Message\ResponseInterface $response = NULL, ?Exception $previous = NULL, array $ctx = [])
 
Factory method to create a new exception with a normalized error message

  • return self
public static getResponseBodySummary(Psr\Http\Message\ResponseInterface $response)
 
Get a short summary of the response

Will return null if the response is not printable.

  • return string|null
private static obfuscateUri(Psr\Http\Message\UriInterface $uri)
 
Obfuscates URI if there is a username and a password present

  • return UriInterface
public static wrapException(Psr\Http\Message\RequestInterface $request, Exception $e)
 
Wrap non-RequestExceptions with a RequestException

© 2020 Bruce Wells
Search Namespaces \ Classes
ConfigurationNumbers (0-9.) only