private function validateResult(array $responseArr, $httpCode)
    {
        $httpCode = (int) $httpCode;

        if ($httpCode === 200) {
            // The request is successful - nothing to do
            return;
        }

        $errorMessage = $this->getErrorMessage($responseArr);
        $errorCode = isset($responseArr['code']) ? $responseArr['code'] : 'Error';

        // Throw the error message that's included in the response
        if (!empty($errorMessage)) {
            throw new AmlException("$errorCode - {$errorMessage}", $httpCode);
        }

        // Throw a general error message
        throw new AmlException("{$errorCode} - Server responded with {$httpCode}", $httpCode);
    }
private function validateResult(array $responseArr, $httpCode)
    {
        $httpCode = (int) $httpCode;

        if ($httpCode === 200) {
            // The request is successful - nothing to do
            return;
        }

        $errorMessage = $this->getErrorMessage($responseArr);
        $errorCode = isset($responseArr['code']) ? $responseArr['code'] : 'Error';

        // Throw the error message that's included in the response
        if (!empty($errorMessage)) {
            throw new AmlException("$errorCode - {$errorMessage}", $httpCode);
        }

        // Throw a general error message
        throw new AmlException("{$errorCode} - Server responded with {$httpCode}", $httpCode);
    }
private function validateResult ( array $ responseArr , $ httpCode ) { $ httpCode = ( int ) $ httpCode ; if ( $ httpCode === 200 ) { // The request is successful - nothing to do return ; } $ errorMessage = $ this -> getErrorMessage ( $ responseArr ) ; $ errorCode = isset ( $ responseArr [ 'code' ] ) ? $ responseArr [ 'code' ] : 'Error' ; // Throw the error message that's included in the response if ( ! empty ( $ errorMessage ) ) { throw new AmlException ( "$errorCode - {$errorMessage}" , $ httpCode ) ; } // Throw a general error message throw new AmlException ( "{$errorCode} - Server responded with {$httpCode}" , $ httpCode ) ; }
Handle request result.

@param array $responseArr
@param int $httpCode

@throws AmlException
Handle request result .