def __init__(self, response, _message=None):
        status = response.status
        reason = response.reason
        body = response.body.read()
        detail = XML(body).findtext("./messages/msg")
        message = "HTTP %d %s%s" % (
            status, reason, "" if detail is None else " -- %s" % detail)
        Exception.__init__(self, _message or message)
        self.status = status
        self.reason = reason
        self.headers = response.headers
        self.body = body
        self._response = response
dataset/ETHPy150Open hvandenb/splunk-elasticsearch/search-elasticsearch/bin/splunklib/binding.py/HTTPError.__init__/original