protected function handleErrorResponse( ResponseInterface $response ){

        $body = json_decode($response->getBody(), true);

        $message = "HTTP:{$response->getStatusCode()}";

        throw new Exception\ApiException( $message, $response->getStatusCode(), $body, $response );

    }
protected function handleErrorResponse( ResponseInterface $response ){

        $body = json_decode($response->getBody(), true);

        $message = "HTTP:{$response->getStatusCode()}";

        throw new Exception\ApiException( $message, $response->getStatusCode(), $body, $response );

    }
protected function handleErrorResponse ( ResponseInterface $ response ) { $ body = json_decode ( $ response -> getBody ( ) , true ) ; $ message = "HTTP:{$response->getStatusCode()}" ; throw new Exception \ ApiException ( $ message , $ response -> getStatusCode ( ) , $ body , $ response ) ; }
Called with a response from the API when the response code was unsuccessful. i.e. not 20X.

@param ResponseInterface $response

@return null
@throw Exception\ApiException
Called with a response from the API when the response code was unsuccessful . i . e . not 20X .