private function processResponse(ResponseInterface $response)
    {
        if($response->getStatusCode() != 200){
            throw new YouHostingException("The API returned with a non-successful error code: ".$response->getStatusCode());
        }

        $json = $response->json();

        if(!empty($json['error'])){
            throw new YouHostingException($json['error']['message'], $json['error']['code']);
        }

        return $json['result'];
    }
private function processResponse(ResponseInterface $response)
    {
        if($response->getStatusCode() != 200){
            throw new YouHostingException("The API returned with a non-successful error code: ".$response->getStatusCode());
        }

        $json = $response->json();

        if(!empty($json['error'])){
            throw new YouHostingException($json['error']['message'], $json['error']['code']);
        }

        return $json['result'];
    }
private function processResponse ( ResponseInterface $ response ) { if ( $ response -> getStatusCode ( ) != 200 ) { throw new YouHostingException ( "The API returned with a non-successful error code: " . $ response -> getStatusCode ( ) ) ; } $ json = $ response -> json ( ) ; if ( ! empty ( $ json [ 'error' ] ) ) { throw new YouHostingException ( $ json [ 'error' ] [ 'message' ] , $ json [ 'error' ] [ 'code' ] ) ; } return $ json [ 'result' ] ; }
Preprocess the result to check whether the request was successful

@param ResponseInterface $response
@return mixed
@throws YouHostingException
Preprocess the result to check whether the request was successful