src/Net/Http/Client.php
private function checkResponse($ch)
	{
		$this->responseInfo = curl_getinfo($ch);

		if (curl_errno($ch)) {
			throw new Net_Http_NetworkError(curl_error($ch), curl_errno($ch));
		}
		if ($this->failOnError) {
			$status = $this->getStatus();
			if ($status >= 400 && $status <= 499) {
				throw new Net_Http_ClientError($this->getStatusMessage(), $status, $this->getResponse());
			} elseif ($status >= 500 && $status <= 599) {
				throw new Net_Http_ServerError($this->getStatusMessage(), $status, $this->getResponse());
			}
		}
		if ($this->followLocation) {
			$this->followRedirectPath();
		}
	}
private function checkResponse($ch)
	{
		$this->responseInfo = curl_getinfo($ch);

		if (curl_errno($ch)) {
			throw new Net_Http_NetworkError(curl_error($ch), curl_errno($ch));
		}
		if ($this->failOnError) {
			$status = $this->getStatus();
			if ($status >= 400 && $status <= 499) {
				throw new Net_Http_ClientError($this->getStatusMessage(), $status, $this->getResponse());
			} elseif ($status >= 500 && $status <= 599) {
				throw new Net_Http_ServerError($this->getStatusMessage(), $status, $this->getResponse());
			}
		}
		if ($this->followLocation) {
			$this->followRedirectPath();
		}
	}
private function checkResponse ( $ ch ) { $ this -> responseInfo = curl_getinfo ( $ ch ) ; if ( curl_errno ( $ ch ) ) { throw new Net_Http_NetworkError ( curl_error ( $ ch ) , curl_errno ( $ ch ) ) ; } if ( $ this -> failOnError ) { $ status = $ this -> getStatus ( ) ; if ( $ status >= 400 && $ status <= 499 ) { throw new Net_Http_ClientError ( $ this -> getStatusMessage ( ) , $ status , $ this -> getResponse ( ) ) ; } elseif ( $ status >= 500 && $ status <= 599 ) { throw new Net_Http_ServerError ( $ this -> getStatusMessage ( ) , $ status , $ this -> getResponse ( ) ) ; } } if ( $ this -> followLocation ) { $ this -> followRedirectPath ( ) ; } }
Check the response for possible errors. If failOnError is true
then throw a protocol level exception. Network errors are always
raised as exceptions.

@throws Net_Http_ClientError
@throws Net_Http_NetworkError
@throws Net_Http_ServerError
Check the response for possible errors . If failOnError is true then throw a protocol level exception . Network errors are always raised as exceptions .