// Any 500 status number (500, 501) means there was a server error
if( responseCode >= 500 )
{
log.error( "Server returned error code: " + responseCode + " " + responseMessage );
throw new NetException( Net.ERR_HTTP_SERVER );
}
else if( responseCode != HttpConnection.HTTP_OK )
{
log.debug( "Server returned unhandled code: " + responseCode + " " + responseMessage );
// ShouldDo: handle redirects?
throw new NetException( Net.ERR_HTTP_UNHANDLED );
}
else
{
contentType = connection.getType();
contentLength = (int) connection.getLength();
log.debug( "content-type: " + contentType + ", content-length: " + contentLength );
}
in = new NetInputStream( this, connection.openDataInputStream() );
return in;
}
catch( IOException e )
{
throw new NetException( Net.ERR_HTTP_IO, e );
}
}