'Composes a response for the given HTTPError instance.'

def _compose_error_response(self, req, resp, error):

    resp.status = error.status
    if (error.headers is not None):
        resp.set_headers(error.headers)
    if error.has_representation:
        self._serialize_error(req, resp, error)
