def _extract_error_json(body):
    """Return error_message from the HTTP response body."""
    error_json = {}
    try:
        body_json = json.loads(body)
        if 'error_message' in body_json:
            raw_msg = body_json['error_message']
            error_json = json.loads(raw_msg)
        else:
            error_body = body_json['errors'][0]
            raw_msg = error_body['title']
            error_json = {'faultstring': error_body['title'],
                          'debuginfo': error_body['detail']}

    except __HOLE__:
        return {}

    return error_json
dataset/ETHPy150Open openstack/python-magnumclient/magnumclient/common/httpclient.py/_extract_error_json