public static function create(
        RequestInterface $request,
        ResponseInterface $response,
        \Exception $previous = null,
        array $ctx = []
    ) {
        $data = \GuzzleHttp\json_decode($response->getBody(), true);
        MpxExceptionTrait::validateData($data);

        $altered = $response->withStatus($data['responseCode'], $data['title']);

        return self::createException($request, $altered, $previous, $ctx);
    }
public static function create(
        RequestInterface $request,
        ResponseInterface $response,
        \Exception $previous = null,
        array $ctx = []
    ) {
        $data = \GuzzleHttp\json_decode($response->getBody(), true);
        MpxExceptionTrait::validateData($data);

        $altered = $response->withStatus($data['responseCode'], $data['title']);

        return self::createException($request, $altered, $previous, $ctx);
    }
public static function create ( RequestInterface $ request , ResponseInterface $ response , \ Exception $ previous = null , array $ ctx = [ ] ) { $ data = \ GuzzleHttp \ json_decode ( $ response -> getBody ( ) , true ) ; MpxExceptionTrait :: validateData ( $ data ) ; $ altered = $ response -> withStatus ( $ data [ 'responseCode' ] , $ data [ 'title' ] ) ; return self :: createException ( $ request , $ altered , $ previous , $ ctx ) ; }
Create a new MPX API exception.

@param \Psr\Http\Message\RequestInterface  $request
@param \Psr\Http\Message\ResponseInterface $response
@param \Exception|null                     $previous
@param array                               $ctx

@return \Lullabot\Mpx\Exception\ClientException|\Lullabot\Mpx\Exception\ServerException
Create a new MPX API exception .