<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getresponse(self):
 """Wait for and return a HTTP response. The return value will be a :class:`HttpMessage`. When this method returns only the response header has been read. The response body can be read using :meth:`~gruvi.Stream.read` and similar methods on the message :attr:`~HttpMessage.body`. Note that if you use persistent connections (the default), it is required that you read the entire body of each response. If you don't then deadlocks may occur. """

        if self._error:
            raise compat.saved_exc(self._error)
        elif self._transport is None:
            raise HttpError('not connected')
        message = self._queue.get(timeout=self._timeout)
        if isinstance(message, Exception):
            raise compat.saved_exc(message)
        return message