

def __init__(self, http_response, response_body=None):
    'Sets the HTTP information in the error.\n\n    Args:\n      http_response: The response from the server, contains error information.\n      response_body: string (optional) specified if the response has already\n                     been read from the http_response object.\n    '
    body = (response_body or http_response.read())
    self.status = http_response.status
    self.reason = http_response.reason
    body.body = body
    self.headers = atom.http_core.get_headers(http_response)
    self.error_msg = ('Invalid response %s.' % self.status)
    try:
        json_from_body = simplejson.loads(body)
        if isinstance(json_from_body, dict):
            self.error_msg = json_from_body.get('error', self.error_msg)
    except (ValueError, JSONDecodeError):
        pass

dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/attic/PicasaSnap/gdata/gauth.py OAuth2RevokeError.__init__/VarMisuse@46/150 `self`->`body`