Method | Description | |
---|---|---|
__construct ( $message, Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response = null, Exception $previous = null, array $handlerContext = [] ) | ||
create ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response = null, Exception $previous = null, array $ctx = [] ) : self | Factory method to create a new exception with a normalized error message | |
getHandlerContext ( ) : array | Get contextual information about the error from the underlying handler. | |
getRequest ( ) : Psr\Http\Message\RequestInterface | Get the request that caused the exception | |
getResponse ( ) : Psr\Http\Message\ResponseInterface | null | Get the associated response | |
getResponseBodySummary ( Psr\Http\Message\ResponseInterface $response ) : string | null | Get a short summary of the response | |
hasResponse ( ) : boolean | Check if a response was received | |
wrapException ( Psr\Http\Message\RequestInterface $request, Exception $e ) : |
Wrap non-RequestExceptions with a RequestException |
Method | Description | |
---|---|---|
obfuscateUri ( Psr\Http\Message\UriInterface $uri ) : Psr\Http\Message\UriInterface | Obfuscates URI if there is an username and a password present |
public __construct ( $message, Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response = null, Exception $previous = null, array $handlerContext = [] ) | ||
$request | Psr\Http\Message\RequestInterface | |
$response | Psr\Http\Message\ResponseInterface | |
$previous | Exception | |
$handlerContext | array |
public static create ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response = null, Exception $previous = null, array $ctx = [] ) : self | ||
$request | Psr\Http\Message\RequestInterface | Request |
$response | Psr\Http\Message\ResponseInterface | Response received |
$previous | Exception | Previous exception |
$ctx | array | Optional handler context. |
return | self |
public getHandlerContext ( ) : array | ||
return | array |
public getRequest ( ) : Psr\Http\Message\RequestInterface | ||
return | Psr\Http\Message\RequestInterface |
public getResponse ( ) : Psr\Http\Message\ResponseInterface | null | ||
return | Psr\Http\Message\ResponseInterface | null |
public static getResponseBodySummary ( Psr\Http\Message\ResponseInterface $response ) : string | null | ||
$response | Psr\Http\Message\ResponseInterface | |
return | string | null |
public hasResponse ( ) : boolean | ||
return | boolean |
public static wrapException ( Psr\Http\Message\RequestInterface $request, Exception $e ) : |
||
$request | Psr\Http\Message\RequestInterface | |
$e | Exception | |
return |