AbstractJsonExceptionParser
in package
implements
ExceptionParserInterface
AbstractYes
Parses JSON encoded exception responses
Table of Contents
Interfaces
- ExceptionParserInterface
- Interface used to parse exceptions into an associative array of data
Methods
- parse() : array<string|int, mixed>
- Parses an exception into an array of data containing at minimum the following array keys: - type: Exception type - code: Exception code - message: Exception message - request_id: Request ID - parsed: The parsed representation of the data (array, SimpleXMLElement, etc)
- doParse() : array<string|int, mixed>
- Pull relevant exception data out of the parsed json
Methods
parse()
Parses an exception into an array of data containing at minimum the following array keys: - type: Exception type - code: Exception code - message: Exception message - request_id: Request ID - parsed: The parsed representation of the data (array, SimpleXMLElement, etc)
public
parse(RequestInterface $request, Response $response) : array<string|int, mixed>
Parameters
- $request : RequestInterface
- $response : Response
-
Unsuccessful response
Return values
array<string|int, mixed>doParse()
Pull relevant exception data out of the parsed json
protected
abstract doParse(array<string|int, mixed> $data, Response $response) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>
-
The exception data
- $response : Response
-
The response from the service containing the error