private function handleError($response)
    {
        $error = json_decode($response->getBody(), false);
        $errorCode = $error->errorCode;

        try {
            if (array_key_exists($errorCode, $this->error_exceptions)) {
                throw new $this->error_exceptions[$errorCode];
            }

            throw new $this->error_exceptions[$response->getStatusCode()];
        } catch (Exception $e) {
            throw new \Exception("There was a malformed response from IPBoard.");
        }
    }
private function handleError($response)
    {
        $error = json_decode($response->getBody(), false);
        $errorCode = $error->errorCode;

        try {
            if (array_key_exists($errorCode, $this->error_exceptions)) {
                throw new $this->error_exceptions[$errorCode];
            }

            throw new $this->error_exceptions[$response->getStatusCode()];
        } catch (Exception $e) {
            throw new \Exception("There was a malformed response from IPBoard.");
        }
    }
private function handleError ( $ response ) { $ error = json_decode ( $ response -> getBody ( ) , false ) ; $ errorCode = $ error -> errorCode ; try { if ( array_key_exists ( $ errorCode , $ this -> error_exceptions ) ) { throw new $ this -> error_exceptions [ $ errorCode ] ; } throw new $ this -> error_exceptions [ $ response -> getStatusCode ( ) ] ; } catch ( Exception $ e ) { throw new \ Exception ( "There was a malformed response from IPBoard." ) ; } }
Throw the error specific to the error code that has been returned.

All exceptions are dynamically thrown.  Where an exception doesn't exist for an error code, \Exception is thrown.

@param ResponseInterface $response The IPBoard error code.

@throws \Exception
@throws \Alawrence\Ipboard\Exceptions\IpboardInvalidApiKey
@throws \Alawrence\Ipboard\Exceptions\IpboardThrottled
@throws \Alawrence\Ipboard\Exceptions\IpboardMemberIdInvalid
@throws \Alawrence\Ipboard\Exceptions\IpboardMemberInvalidGroup
@throws \Alawrence\Ipboard\Exceptions\IpboardMemberUsernameExists
@throws \Alawrence\Ipboard\Exceptions\IpboardMemberEmailExists
Throw the error specific to the error code that has been returned .